It's been almost a year since I posted my first article on git aliases. Since then I've applied a number of additional aliases in my workflow. Be sure to check out my first article here to how I use "git update", "git nah", and "git amend".
Without further ado, here they are:
This command lets you arrange all commits you made in a feature branch. Perfect for cleaning up commits before creating a PR.
git config --global alias.arrange "rebase -i develop"
If you often find yourself switching branches, this is a lifesaver. It will list all branches sorted by recent use.
git config --global alias.recent "branch --sort=-committerdate" # most recent branches
Ever wanted to stash your code, but keep everything you staged (with
git add .)
git config --global alias.stash-unstaged "stash save --keep-index -u"
This will allow you to remove the latest commit and move all the changes back into your working directory. With this, I often prefer committing instead of stashing code that I need for later, because it makes it so much simpler than searching through a list of stashes.
git config --global alias.undo-commit "reset HEAD~ --soft"
What aliases did you apply in your workflow? Let me know in the comments ✌️
If this article helped you, I have a lot more tips on simplifying writing software here.