Git Config Settings I Always Recommend

If you’ve ever worked on a project with me then I’ve probably recommended at least one of these config settings in git. git config --global pull.rebase true - tells git to always pull with rebase instead of merge (the equivalent of pull --rebase). git config --global fetch.prune true - tells git to automatically run git remote prune after a fetch. This will clean up any local objects that no longer exist on the remote like tracking branches that have been deleted from the remote server. »

You Should be Using Git Hooks

In my opinion Git hooks are an incredibly useful yet under-utilized feature of git. There are lots of resources that go into hooks in detail but here I’m just going to list some of the ones I find myself using over and over again. prepare-commit-msg This hooks is great for templating your commit messages. This post does a great job of highlighting some powerful possibilities. I like to use it to automatically insert a ticket number from the current branch name. »