Skip to content

Instantly share code, notes, and snippets.

@emk
Created February 12, 2009 15:45
Show Gist options
  • Save emk/62689 to your computer and use it in GitHub Desktop.
Save emk/62689 to your computer and use it in GitHub Desktop.
# 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