Created
July 22, 2012 02:30
-
-
Save noahd1/3157987 to your computer and use it in GitHub Desktop.
local_ownership
This file contains 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/sh | |
#/ Usage: transfer-master path-to-repo( path-to-repo( path-to-repo))... | |
#/ Changes master to reference new master | |
set -e | |
# show program usage | |
if [ $# -eq 0 -o "$1" = "--help" ] | |
then | |
grep '^#/' <"$0" | | |
cut -c4- | |
exit 2 | |
fi | |
original_path=`pwd` | |
for repository_path in "$@" | |
do | |
cd $original_path | |
if test -d $repository_path && cd $repository_path && test `git config remote.origin.url | grep efficiency20` | |
then | |
new_repository_url=`git config remote.origin.url | sed 's/efficiency20/c3-e/'` | |
git remote rename origin old-origin | |
git remote add origin "$new_repository_url" | |
git fetch origin | |
git remote rm old-origin | |
git branch --set-upstream master origin/master | |
# git pull --rebase | |
else | |
echo "Skipping $repository_path because it is not an efficiency20 git repository." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment