WIP Commits
Upgrade Your Git: WIP
If you’ve been a developer for a decent amount of time, you’re probably familiar with git; it’s the de-facto source control system for coders. RIP Mercurial, SVN, and the others.
You should have your own .gitconfig
, and you should be pretty familiar with
git. You should also probably know that
“git-flow” is not
the best thing.
Here’s an actual helpful piece of git-fu: sometimes when you’re working you should take a break and just add everything to a temporary commit. This is what I call a “Work in Progress,” or WIP commit. You do this especially when you’re in the middle of trying something out, and you need to take a left turn or when you get interrupted by something that would take you away from your current work.
The alias
Ok I’ve spent enough time hyping this up.
here’s the alias, put it in your .gitconfig
under [alias]
wip = commit -am "WIP"
That’s it! And you use it like this:
git add ./
git wip
Assuming you’re at the root and your .gitignore
is set up right.
If you’re like me you probably have a bunch of WIP’s. So you might want to add a little to your commits. Fortunately you can just do this
git wip -m "this is what I was doing"
You’ll get the “WIP” message along with your new message. Pretty neat!
Don’t push WIPs to Main
If you’re making a lot of progress, and you’re working on stuff, then you should not push WIP’s to your main branch. They’re noisy and don’t tell you much, except that you were working on something.
Think of your commit history like a story - if you can cut out filler like “I was doing work” then cut it. If you don’t know about squashing, then maybe I can tell you more secrets:
git rebase HEAD~n -i
Where n
is the number of commits since Main.
You shouldn’t squash on any branch that multiple people need - you’re rewriting history, which sounds way scarier than it is.
Feel free to squash your WIP’s, you have my permission.