Top 10 Git Commands With Examples

What is Git ?

Git is a open source distributed version control system tool designed by Linus Torvalds in 2005 to develop Linux Kernel. Git is designed for coordinating work among developers and teams and it can also be used to track changes in any set of files. It is useful to handle the projects from small to very large size with speed and efficiency.

There are hundreds of commands in Git to use, but in this article you will find the Top 10 Git Commands that will be frequently used by developers while working with Git.

Top 10 Git Commands

git config

This command sets the configuration values for username and email

git config –global user.name “your username”
git config –global user.email “your email address”

git init

This command creates a new git repository in a new or already existing project

git init

Initialized empty Git repository in /home/documents/username/GIT/.git/

git status

This command will list all the files that are untracked, modified and staged.

git status

# On branch master #
# Initial commit #
# Untracked files: #
# (use “git add …” to include in what will be committed) #

git add

This command git add [filename] is used to add the files to staging area and to add one more to the staging area we will use git add *

Usage: git add [filename]

git add project_name

Usage: git add *

git add *