Top Must know Git Commands for working with git

If you are working with git, you should know some commands which are mandatory and basics for getting started. In this post, we will list the commands which we are going to use as we start learning about git. The details of how to use those commands are mentioned in separate posts referenced as below.

 $ git init 

Git init Creates an empty Git repository or reinitialize an existing one.

 $ git add 

“git add” command updates the index using the current content found in the working tree, to prepare the content staged for the next commit.

 $ git config 

“git config” command displays and sets the local repository level configuration options as well as global configuration which persists across the git repositories.

 $ git status 

“git status” command shows the current working directory status which displays if there are any files which has not been tracked by git and are modified, and if all files are tracked by git.

 $ git commit 

“git commit” Stores the current contents of the index in a new commit along with a log message from the user describing the changes.

 $ git log 

“git log” command shows the history of your previous commits which shows who is the author of previous code, when the code was modified.

 $ git branch 

“git branch” command allows your to see all available branches in your code, which is the current active branch, create branch and delete branch

You can refer “Starting your first Git Repository” to understand how this commands are getting used during live project.

Follow Lynxbee

Leave a Reply / Ask Question