Git Rebasing Setup git-pull for automatically perform a rebase instead of a merge

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

If your team is following a rebase-based workflow, it may be a advantageous to setup git so that each newly created branch will perform a rebase operation, instead of a merge operation, during a git pull.

To setup every new branch to automatically rebase, add the following to your .gitconfig or .git/config:

[branch]
autosetuprebase = always

Command line: git config [--global] branch.autosetuprebase always

Alternatively, you can setup the git pull command to always behave as if the option --rebase was passed:

[pull]
rebase = true

Command line: git config [--global] pull.rebase true



Got any Git Question?