It's Daily Standup time and there you are: unsure about what you did since yesterday - not because you did nothing but because you forget things easily. 😂
Yeah, the person here is me, and I often can't answer quickly when I'm asked "What have you done today?". Well, fortunately, I'm a programmer who knows Git, and I made a command that quickly reminds me of what I've done since yesterday:
Cool, right? Yeah, this is a Git alias, a shortcut for a more complex Git command. Git aliases reside on a file named
.gitconfig in your home folder. To set up my own
git standup alias, I added the following line to
[alias] standup = log --all --since yesterday --author=joelwallis
This aliased Git command will list all commits from all branches that have been made in the last 24 hours by an author that contains
joelwallis somewhere on his name or email.
You might want to change the author field with something unique to your name/email.
Note: if you already have a
[alias]line on your
.gitconfigthere's no need to add another one. Just make sure your
standupalias is placed after it.
This is it. After saving the file, you'll be able to use your alias as a Git subcommand:
Pro tip: since I tend to prefer shorter outputs, I empowered my
git standup with some additional flags:
[alias] standup = log --abbrev-commit --all --author=joelwallis --since yesterday --pretty=oneline
git standup outputs something like this:
$ git standup 7b2280e (origin/branch-123) I did something awesome here 7b2280e (branch-123) Here goes a hidden bug packed as a feature to production 15f61fa (refs/stash) WIP 433ed2b index on branch-456: e6f9335 This is another great commit
PS: if you're curious about how my
.gitconfig looks like, it's public on my GitHub. You can check it here.
How about you? Do you have any Git trick that makes your life as a developer easier? Share it in the discussions below. 🙂