What is Git?

Git is the most commonly used version control system in software industry.It tracks the changes that you make to the files and also makes collaboration easier within the team.
Below are the list of basic git commands that everyone should understand.


git config

  • git config -global user.name "[give your name]"
  • git config -global user.email "[give your email]"
The above command sets the author name and email address to be used in git commits.

git init

  • git init "[repositoryName]"
The command used to create/start new git repository

git clone

  • git clone "[repositoryURL]"
The command used to fetch/obtain existing repository from git

git add

  • git add "[FilePath]"
  • git add *
The command used to add the specific file OR more files to staging area

git commit

  • git commit -m "Commit message...."
The command used to commit into git with user provided commit message

git status

  • git status
The command shows/lists all the modified files that have to be committed

git checkout

  • git checkout [branchName]
  • The command is used to switch from one branch to another.

  • git checkout -b [branchName]
  • The command is used to create new branch in git

git pull

  • git pull
  • The command is used to fetch latest changes on repository remote server to your working directory

git push

  • git push origin [branchName]
  • The command is used to push the committed changes into remote server of the git branch

git merge

  • git merge [branchName]
The command is used to merge the specified branch history into the current branch.
Categories: