Tips for creating merge commits

I鈥檝e reviewed quite a few pull requests in recent years and I鈥檝e noticed some less-than-ideal practices when it comes to creating merge commits so I thought I鈥檇 list some things you can do to make life a little easier for someone reviewing your code. Make the commit message as useful as possible A lot has been written about how to write good commit messages, but I rarely see the advice applied to merge commits....

August 31, 2024 路 4 min 路 Brandon Pugh

Git Config Settings I Always Recommend

If you鈥檝e ever worked on a project with me then I鈥檝e 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). This not only saves you having to type the flag every time, but also ensures gui clients will also use rebase when pulling. Note: You should only enable this if you鈥檙e comfortable with rebasing....

March 5, 2022 路 updated January 31, 2024 路 2 min 路 Brandon Pugh

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鈥檓 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....

May 1, 2019 路 2 min 路 Brandon Pugh