Created
April 23, 2013 12:08
-
-
Save 0xGGGGG/5443043 to your computer and use it in GitHub Desktop.
a bash script to make rebasing default on git-pull
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Makes rebasing default on git-pull | |
# Run it on the working-git-directory | |
echo "Existing branch's default action is being updated" | |
for file in $(find . -type d -name ".git") | |
do | |
LENGTH=${#file} | |
PRPATH="${file:0:LENGTH-4}" | |
pushd $PRPATH | |
git for-each-ref --shell --format='git config branch.%(refname:short).rebase true' refs/heads/ | sh | |
popd | |
done | |
echo "Global rebase config is done" | |
git config --global branch.autosetuprebase always | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment