Till now in this course, we have installed Git on our systems and as we already know, we will be using Git Bash in this complete course. We have understood the concept and terminologies used in Git and it is time now that we start using Git Bash and do some practical stuff.

In this tutorial, we will focus on

  • What is Git Help?
  • How to list all the Git Commands
  • How to get help on particular command?
  • How to open Git official doc help from Git Bash?

What is Git Help?

Like any other software's help option, Git Help is also an option in Git to get help for new beginners like you. Git does not have an option field or command. Git Help can be accessed from your Git Bash just by typing the command git help.

git_help_command

Press Enter to execute the help command.

git_help

This command will display all the information about Git. These are brief information to get any beginner started. These commands as shown above are the most common commands used in Git. These are just some brief intro though, we will see all the available commands in the next section.

How to List all the Git Commands?

The command used in the last section i.e. git help is the larger command if I must say. This can be used to get more specific results and more specific commands according to us.

If we need to see all the available commands in Git, we need to use the following command.

*git help -a or git help - -a

git_help_--a_command

Note: One is with single '-' and other is with double but no space between '- -'

Press enter to execute the command

git_help_--a

This will show you all the available commands in Git. If you scroll till the end after the command you will three-line information. This is constant no matter what command you execute.

Command_Info_Scroll

Note: The same command i.e. git help -a is similar to git help --all command. You can try that out too. The result will be similar.

It is also noteworthy that git bash will suggest you the correct command in case you enter a wrong command. For example, let us try to execute the command git help -all in git bash and see what happens.

git_wrong_command_execution

It tells us that maybe we wanted the command to be with two dashes. Now let's move onto the next section and explore a bit more.

How to access Help on particular Command?

It is very easy to get help on one particular command. In the above section, we listed all the available commands in git and there can be cases where you either don't know a particular command and want to know about it or you know a command name and want to know the syntax. Whatever be the case, the following steps will tell you about the particular command.

  1. List all the commands using git help -a

  2. Choose any command from the option, here I am choosing fetch.

  3. Type the following command with your chosen command

git help <command name>

git_help_fetcha

  1. Press enter and the "fetch" manual will open up in your browser.

git_fetch_manual_page

This page will contain all the information about the command you typed. The information until now is enough for any beginner to just start and try brushing some commands. In the next section, we will show you how to get official doc help in git bash.

How to access Git Guide from Git Bash?

In the previous section we showed that when you scroll to the end of the result (of the command you execute), an option is there.

Command_Info_Scroll

This option is git help -g. This command, as shown above, will show you some concept guides. These guides will help you get started in your journey through git. Let's explore this command.

Enter the command git help -g

git_help_-g

Press enter to execute the command

git_help_g_result

This will show you the common Git guides available. You can also see the summary in front of the guide name. For example the guide named "attributes" defines the attributes in git per path. The guide "everyday" will have the commands used commonly, etc.

To open any specific guide, type the following in the git bash

git help <guide_name>

git_help_attributes

Press enter to execute the command. This will open the manual about attribute in your browser just like it opened above about fetch.

git_attribute_manual_page

So by this, we have come to the end of this tutorial. I hope you have something now to spend time on git bash. Keep practicing all these commands through hit and try. We will move onto our next tutorial now.

Install Git on Windows
Install Git on Windows
Previous Article
Set Up Default Credentials for Git Config
Set Up Default Credentials for Git Config
Next Article
Harish Rajora
I am a computer science engineer. I love to keep growing as the technological world grows. I feel there is no powerful tool than a computer to change the world in any way. Apart from my field of study, I like reading books a lot and developing new stuff.
Reviewers
Lakshay Sharma's Photo
Lakshay Sharma

Similar Articles

Feedback