| git commands | description |
| git <branch> | lists all the branches |
| git checkout <branch> | switches to <branch> |
| git sudo update | it'll figure out the latest version of each package and its dependency, but will not download or install any of those updates. |
| git sudo upgrade | downloads and installs the updates for each outdated package and dependency |
| git pull | pulls all the latest files of the branch from remote repo |
| git commit -m "msg" | adds log message |
| git commit --amend -m "new_msg" | updates latest log message |
| git commit --amend --author="xyz <xyz@gmail.com" --no-edit | updates author |
| git config --global user.name "xyz" | - |
| git config --global user.email "xyz@gmail.com" | - |
| git push origin <branch> | pushes changes to remote branch |
| git merge branch-1 | merges branch-1 changes to <current_branch> |
| git reset --soft HEAD~1 | Delete the most recent commit, keeping the work you've done |
| git reset --hard HEAD~1 | Delete the most recent commit, destroying the work you've done |
| git reset HEAD^ | remove commit locally |
| git push origin +HEAD | force-push the new HEAD commit. HEAD points to the top of the current branch. git can obtain the branch name from that. So it's the same as: git push origin CURRENT_BRANCH_NAME |
Command Palette
Search for a command to run...
Comments
Join the discussionNo comments yet. Be the first to comment.
More from this blog
Numpy - Part 1
Machine Learning basics
CSS - Inheritance and Others
As i started learning Cascading, Specificity, Inheritance. Though at a higher level it was bit clear, but i felt difficulty in understanding what does initial, unset do. So i did some more learning, and learnt some more concepts in the process. So a...
Web Browser Engine Overview : For Beginners
Website that you visit/read is a Document. As a human, when you write a Document on a Paper, or lets say print a Newspaper, you see Headlines and some part of the story below it, and links to remaining story on a different page. Some headlines will h...

git - part 2: for Beginners
After that small talk, in this post let's use some git commands. Additional Info:- For complete list of commands, refer this. Refer this Visual Git Cheat Sheet. Refer this for some detailed information. Refer this for commonly used commands. G...
