Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
'git rebase' instead of 'git pull'

Sourced from:

$ # from an individual repo
$ git config branch.master.rebase true

$ # or, set it globally (only works for new repos forward)
$ git config --global branch.autosetuprebase always

If needing to go back and set all branches to rebase by default, run this bash script.


for d in */ ; do
  if [[ -d $d ]]; then
    # change directory 
    pushd "$d" > /dev/null 2>&1
    # set it
    git config branch.master.rebase true
    popd > /dev/null 2>&1

echo "Completed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment