Wink Saville’s Blog

July 5, 2009

git – Remote branches

Filed under: scm — wink @ 1:56 pm

Learned that you can manually create remote branches. This is done having the destination refspec be refs/head. Example:git push ../git2 b2:refs/heads/b2The above will push branch b2 to  repo ../git2.I finally got the force flag (-f) do work. I’ve wanted to do a force when I did a rebase –interactive and of a branch and then wanted to backup it up but I’d get an error about it being a non-fast forward merge. By using <src>:<dst> refspec and the -f it seems to work:

git push ../git2 -f b3:b3

Of course I just tried it and it failed:

error: denying non-fast forward refs/heads/me (you should pull first)To ../git2! [remote rejected] me -> me (non-fast forward)

Also, the following makes and interesting pushes:

git push ../git2 *:*git push ../git2 *:refs/heads/git1-backups/*

I need to investigate how useful they might be?

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.

Powered by WordPress