Skip to main content

Configuring Git to rebase when pulling upstream changes

We are experimenting with following a Git workflow where everyone is allowed to work from and commit directly to the dev branch. This comes with the consequence of having your local version of dev frequently falling behind upstream changes made to the origin/dev branch (the server's version of your local dev branch) as other people push their commits. This can easily lead to a pitfall when pulling changes from the origin/dev branch into your local dev branch because Git defaults to fast-forward or merge when pulling. This means that by default, if the branches diverge (meaning there are both upstream and local changes) it will create a commit with the subject line Merge branch 'dev' of https://git.bugjam.dev/BUGJam/pounce-game into dev. These extra merge commits clutter the repo by creating unnecessary cruft in the commit history and make it difficult to understand the sequence of changes. What needs to happen instead is your local changes need to be rebased on the upstream changes when pulling. The instructions below show how to configure Git on your system to default to rebase when pulling so it will do the right thing for you automatically.

On Windows, you can make this change while installing Git when you get to the prompt in the installer asking "What should `git pull` do by default?". It defaults to Fast-forward or merge. You need to set it to Rebase like in the following screenshot. If you did not change the default pull strategy in the installer, you can still change it manually from the command line. See On all platforms section below.

Screenshot from 2026-02-17 23-54-15.png

On MacOS / Linux, installing git works differently and does not have an installer like on Windows. However, the default pull strategy is still fast-forward or merge, and needs to be changed to rebase.

On all platforms, in a command prompt / terminal set the pull.rebase option to true with the following command:
git config --global pull.rebase true

Confirm the change has been made by running the following command:
git config --get pull.rebase
the command should just print true.

In SourceGit, with the above Git configuration change, it should default to use the system Git pull strategy configuration. Still, make sure when you are pulling that the checkbox for "Use rebase instead of merge" is checked before pulling.

It should look like this:
Screenshot from 2026-02-17 23-15-43.png

Going forward please do not merge origin/dev into your local dev branches. You should be rebasing your local dev branch changes on origin/dev instead. If you ever see the origin/dev branch get merged into your local dev branch with a merge commit with the subject line Merge branch 'dev' of https://git.bugjam.dev/BUGJam/pounce-game into dev (or similar), please do not push that extra merge commit to the repo. Instead, please reach out to one of the many Git experts on our team for help with correcting the mistake before you push your changes.