Created
February 12, 2009 15:45
-
-
Save emk/62689 to your computer and use it in GitHub Desktop.
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
# Move all origin/* refs to the top level and remove the remote. | |
# Basic idea by Johannes Schindelin, some tweaks by me. | |
git_make_origin_refs_local() { | |
git for-each-ref refs/remotes/origin/ > .git/origin-refs && | |
while read sha1 type ref; do | |
test "$ref" != refs/remotes/origin/HEAD || continue | |
git update-ref "refs/heads/${ref#refs/remotes/origin/}" "$ref" | |
done < .git/origin-refs && | |
rm .git/origin-refs && | |
git remote rm origin | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment