DEV Community

Anmol Raj
Anmol Raj

Posted on • Updated on

50 git short commands you should know which pro uses... 😉

Here's 50 git commands for better productivity in your work.

Git Cheat Sheet codes

  1. – git

  2. gst – git status

  3. gl – git pull

  4. gup – git pull --rebase

  5. gp – git push

  6. gd – git diff

  7. gdc – git diff --cached

  8. gdv – git diff -w "$@" | view -

  9. gc – git commit -v

  10. gc! – git commit -v --amend

  11. gca – git commit -v -a

  12. gca! – git commit -v -a --amend

  13. `gcmsg – git commit -m

  14. gco  – git checkout

  15. gcm – git checkout master

  16. gr – git remote

  17. grv – git remote -v

  18. grmv – git remote rename

  19. grrm – git remote remove

  20. gsetr – git remote set-url

  21. grup – git remote update

  22. grbi – git rebase -i

  23. grbc – git rebase --continue

  24. grba – git rebase --abort

  25. gb – git branch

  26. gba – git branch -a

  27. gcount – git shortlog -sn

  28. gcl – git config --list

  29. gcp – git cherry-pick

  30. glg – git log --stat --max-count=10

  31. glgg – git log --graph --max-count=10

  32. glgga – git log --graph --decorate --all

  33. glo – git log --oneline --decorate --color

  34. glog – git log --oneline --decorate --color --graph

  35. gss – git status -s

  36. ga – git add

  37. gm – git merge

  38. grh – git reset HEAD

  39. grhh – git reset HEAD --hard

  40. gclean – git reset --hard && git clean -dfx

  41. gwc – git whatchanged -p --abbrev-commit --pretty=medium

  42. gsts – git stash show --text

  43. gsta – git stash

  44. gstp – git stash pop

  45. gstd – git stash drop

  46. ggpull – git pull origin $(current_branch)

  47. ggpur – git pull --rebase origin $(current_branch)

  48. ggpush – git push origin $(current_branch)

  49. ggpnp – git pull origin $(current_branch) && git push origin $(current_branch)

  50. glp – _git_log_prettily

If i forgot something please write in comment. i appreciate your effort. Thanks 🙏

Top comments (2)

Collapse
 
seokjeon profile image
Se-ok Jeon

Thx for this! This is really what I wanted. Helped A LOT.
Can I translate in Korean this article? If you don't mind, I wanna share this awesome information in Korean. Surely, There will be a link directing to this original one.

Collapse
 
iamaashiqhassan profile image
Info Comment hidden by post author - thread only accessible via permalink
iamaashiqhassan

Hey i am a web developer from PipQuantum any wanna website,app,installation of windows 10,11 etc at a very cheap and affordable price.
Dm me +91 9149455539

Some comments have been hidden by the post's author - find out more