Terminal: Mini-Tricks

If you are working on a shared project and just want to see your own timeline, run this:

git log --author="$(git config user.email)"

How it works: The $(...) syntax tells Zsh to run git config user.email first, and then it plugs your email address right into the --author flag.

You might already know this little trick, but it's too good to skip! When my repo gets messy, I use this to delete every local branch except the one I am currently on:

git branch -D $(git branch | grep -v \*)

Git flags your current branch with a star. We filter it out to avoid cluttering your output with errors.

Want to see what you type most?

history | fc -ln 0 | sort | uniq -c | sort -nr | head

Why check this? If you spot a command you’re typing a dozen times a day, it might be a perfect candidate for a quick alias! It’s totally optional, of course, but it’s a fun way to see if you can make your life a little easier.