Git commands

git help

git help is a command used to access the built-in documentation for Git commands. It provides a convenient way to learn about the various Git commands, their options, and their usage.

When you're new to Git or need a quick reference for a specific command, git help is an invaluable resource. It allows you to explore and understand Git's functionality without having to search for documentation elsewhere.

Examples

Display the manual page for a specific Git command

git help commit

This will open the manual page for git commit in your default text viewer or web browser, depending on your Git configuration. The manual page provides a detailed description of the command, its options, and examples of how to use it.

To navigate the manual page in your terminal, you can use the arrow keys, the Page Up and Page Down keys, and the Q key to exit.

Result:
NAME
       git-commit - Record changes to the repository
 
SYNOPSIS
       git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
                  [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]
                  [-F <file> | -m <msg>] [--reset-author] [--allow-empty]
                  [--allow-empty-message] [--no-verify] [-e] [--author=<author>]
                  [--date=<date>] [--cleanup=<mode>] [--[no-]status]
                  [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]
                  [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]
                  [--] [<pathspec>...]
 
 
DESCRIPTION
       Create a new commit containing the current contents of the index and the given log message describing the changes. The new commit is a direct child of HEAD, usually the tip of the current branch, and the branch is updated to point
       to it (unless no branch is associated with the working tree, in which case HEAD is "detached" as described in git-checkout(1)).
 
       The content to be committed can be specified in several ways:
 
        1. by using git-add(1) to incrementally "add" changes to the index before using the commit command (Note: even modified files must be "added");
        ...

List all available Git commands

git help --all

This will display a list of all Git commands, grouped by category. You can then use git help <command> to learn more about a specific command.

To navigate the list page in your terminal, you can use the arrow keys, the Page Up and Page Down keys, and the Q key to exit.

Result:
See 'git help <command>' to read about a specific subcommand
 
Main Porcelain Commands
add                     Add file contents to the index
am                      Apply a series of patches from a mailbox
archive                 Create an archive of files from a named tree
bisect                  Use binary search to find the commit that introduced a bug
branch                  List, create, or delete branches
bundle                  Move objects and refs by archive
checkout                Switch branches or restore working tree files
cherry-pick             Apply the changes introduced by some existing commits
citool                  Graphical alternative to git-commit
clean                   Remove untracked files from the working tree
clone                   Clone a repository into a new directory
...

List all Git guides and tutorials

In addition to command-specific help, Git also provides built-in guides and tutorials:

git help -g

This will list available guides and tutorials, which you can then access by running git help guide-name, where guide-name is one of the listed topics.

Result:
The Git concept guides are:
core-tutorial    A Git core tutorial for developers
credentials      Providing usernames and passwords to Git
cvs-migration    Git for CVS users
diffcore         Tweaking diff output
everyday         A useful minimum set of commands for Everyday Git
faq              Frequently asked questions about using Git
glossary         A Git Glossary
namespaces       Git namespaces
remote-helpers   Helper programs to interact with remote repositories
submodules       Mounting one repository inside another
tutorial         A tutorial introduction to Git
tutorial-2       A tutorial introduction to Git: part two
workflows        An overview of recommended workflows with Git
...
© 2024-2025 GitByBit.All rights reserved.

Hi! I'm Alex, creator of GitByBit.

And this is Gitopedia—a reference that summarizes knowledge in my Git course.

Gitopedia is designed to be a personal knowledge base. When you progress through the main Git course in VS Code, you unlock all of these topics, one by one, bit by bit. This gives you time to digest the information and gradually build the mental model of Git. Here's an example of how it works:

Learning directly in VS Code lets you practice Git exactly as you would in real life, doing real jobs, writing real code. In addition, the course has access to your actual terminal, so it can point out mistakes, suggest workarounds, etc.

The course is FREE, there are no Ads or other bullshit. There are optional premium add-ons you can purchase, mainly to support my work (regrettably, I have to eat every day), but that's totally up to you.

Learn Git in VS Code