Git Commands You Should Know
Git Commands You Should Know
git clone
linkedin.com/in/mittal-sachin/ instagram.com/sachinmittal2003/
git add
This command is used to add a file to the staging
area.
git add .
staging area.
$ git add .
linkedin.com/in/mittal-sachin/ instagram.com/sachinmittal2003/
git commit
This command takes a snapshot of project's
currently staged changes.
git diff
This command shows the file differences which are
$ git diff
linkedin.com/in/mittal-sachin/ instagram.com/sachinmittal2003/
git diff –staged
This command shows the differences between files
git status
This command shows all the modified files which
$ git status
linkedin.com/in/mittal-sachin/ instagram.com/sachinmittal2003/
git log
This command shows the list of version history.
$ git log
git branch
This command shows all the branches of repo.
$ git branch
linkedin.com/in/mittal-sachin/ instagram.com/sachinmittal2003/
git checkout
This command is used to switch between branches.
linkedin.com/in/mittal-sachin/ instagram.com/sachinmittal2003/
git push
This command sends all committed changes to your
repo.
git merge
This command shows all the branches of repo.
linkedin.com/in/mittal-sachin/ instagram.com/sachinmittal2003/
git pull
This command fetch and merge changes.
git stash
This command temporarily stores all the modified
tracked files.
linkedin.com/in/mittal-sachin/ instagram.com/sachinmittal2003/
Thanks for
Reading