Skip to content
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN DE
Let's talk

15 Git Commands Every Developer Should Know

27. 03. 2023 1 min read intermediate

Git can do much more than add, commit, push. Here are 15 commands that will take you from user to power user.

1. git stash

git stash push -m “WIP: login form” git stash list git stash pop git stash apply stash@{2}

2. git log –oneline –graph

git log –oneline –graph –all –decorate

git bisect start git bisect bad git bisect good v1.0.0

15 Git Commands Every Developer Should Know

git bisect reset

4. git rebase -i

git rebase -i HEAD~5

pick, squash, reword, edit, drop, fixup

5. git cherry-pick

git cherry-pick abc1234

6. git reflog — Safety Net

git reflog git checkout HEAD@{5}

7. git blame

git blame -L 10,20 src/app.py git blame -w # ignores whitespace

8. git diff –staged

git diff –staged git diff –stat

9. git commit –amend

git commit –amend -m “better description” git commit –amend –no-edit

10. git clean

git clean -fd git clean -fdn # dry run

11. git worktree

git worktree add ../hotfix hotfix-branch

12. git shortlog

git shortlog -sn –since=”1 month ago”

13. git tag

git tag -a v1.0.0 -m “Release 1.0” git push origin –tags

14. git reset

git reset –soft HEAD~1 # keeps changes staged git reset –mixed HEAD~1 # changes unstaged git reset –hard HEAD~1 # deletes everything

15. Aliases

git config –global alias.co checkout git config –global alias.st status git config –global alias.undo “reset HEAD~1 –mixed”

Conclusion

These commands cover 95% of situations. Learn them one by one — in a month you’ll be a Git ninja.

gitdevopsproductivity
Share:

CORE SYSTEMS team

We build core systems and AI agents that keep operations running. 15 years of experience with enterprise IT.