Skip to content

Instantly share code, notes, and snippets.

@xiian
Created January 9, 2015 19:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiian/4998c569b5684af026d2 to your computer and use it in GitHub Desktop.
Save xiian/4998c569b5684af026d2 to your computer and use it in GitHub Desktop.
Set up all existing branches to rebase instead of merge
#!/bin/bash
git config branch.autosetuprebase always;
for BRANCH in `git for-each-ref --format='%(refname)' refs/heads/ | sed 's~refs/heads/~~g'`; do
git config branch.$BRANCH.rebase true;
echo "$BRANCH now set up for rebasing"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment