
Git can be intimidating when you’re just starting out. Most developers stick to git add, git commit, and git push, and for the most part, that’s en...
For further actions, you may consider blocking this person and/or reporting abuse
In number 4,
git stash
is the one that stashes your changes so you can safely switch branches e.g. feature-branch -> main branch.git stash pop
"pops" your most recent changes when you come back to the feature-branch so you can pick up where you left off.the first two commands were new to me
huge thanks )
Thanks 👍
Happy to help!
This a great list!
I usually go with
git commit --amend
when I need to fix or update a commit rather thangit reset
git reset --soft HEAD~1, though if you've accidentally added a file to the repo
reset` is a much easier fix.There are also great tools for viewing
git blame
off the command line, like the built-in tools of WebStorm or GitLens for VS Code.Thanks for putting this list together!
Hi Balraj Singh,
Good article, you explain it well.
Checkout the following post to know few more git commands which we shall consider.
dev.to/ramkumar-m-n/19-mind-blowin...
Regards,
Ram
Great list! Another command that has saved me countless times is git worktree. It allows you to check out multiple branches simultaneously in separate directories without switching the main working directory. Super useful when reviewing PRs or working on multiple features at once.
For example, to create a new worktree for a feature branch:
git worktree add ../feature-branch feature-branch
This keeps my workflow seamless without unnecessary stashing or committing unfinished work.
Also, git commit --fixup combined with git rebase -i --autosquash is a game-changer for cleaning up commit history before pushing. It ensures that related changes are automatically grouped when rebasing, keeping the history tidy for team collaboration.
Git has so many hidden gems that make development more efficient. Curious —what’s a lesser-known Git trick that others here swear by?
Definitely saving this for future reference, Thanks for the share
I used 5 / 10 and must say they are all good stuff. Can wait to use bisect next time. Cool article, thanks.
Thanks for sharing 🌲
Very helpful indeed. Thanks for sharing.
Thanks!
Good to know new commands
GitHub desktop does most of the work for me
Very useful for me!!
nice!
Extremely helpful
nice!