This article covers the Top 10 Git Commands every Git beginners must know.
We have handpicked Top 10 Git commands from a very practical point of view which are very much essential for any Git beginners to start with. Most probably even the sequence of the commands mentioned below are arranged in a way they need to be used.
Page Contents
Git commands Covered
- git config
- git clone
- git branch
- git checkout
- git status
- git add
- git commit
- git push
- git pull
- git merge
Top 10 Git commands
1. git config
git config –global user.name “<username>”
git config –global user.email “<useremail>”
git-config – Get and set repository or global options
https://git-scm.com/docs/git-config
2. git clone
git clone <repository-url> [ eg: ]
git-clone – Clone a repository into a new directory
Create a local copy of a remote repository
https://git-scm.com/docs/git-clone
3. git branch
git branch <branch-name>
git-branch – List, create or delete branches
Create a new branch
https://git-scm.com/docs/git-branch
4. git checkout
git checkout <branch-name>
git-checkout – Switch branches or restore working tree files
Switch to a branch
https://git-scm.com/docs/git-checkout
5. git status
git status
git-status – Show the working tree status
show the status of the current working branch or repo
https://git-scm.com/docs/git-status
6. git add
git add or git add -A
git-add – Add file contents to the index
Add a file to the staging area
https://git-scm.com/docs/git-add
7. git commit
git commit -m “”
git-commit – Record changes to the repository
commit changes
https://git-scm.com/docs/git-commit
8. git push
git push -u origin
git-push – Update remote refs along with associated objects
Push changes to the remote repository (and remember the branch)
https://git-scm.com/docs/git-push
9. git pull
git pull origin master
git-pull – Fetch from and integrate with another repository or a local branch
Pull changes from remote repository
https://git-scm.com/docs/git-pull
10. git merge
git merge <branch-name>
git-merge – Join two or more development histories together
Merge a branch into the active branch
https://git-scm.com/docs/git-merge
Hope this article helped you understand which are the basic git commands you must know if you are just a beginner in the world of Git. If you like the article, feel free to share it with your friends and colleagues and also comment below and let me know your feedback.
For more on rohutech, A must read article if you have still not bought any domains –