I recently used git svn branchto create a branch (in both Subversion and git).
I noticed that (for some reason, I’m not sure, maybe an error, or maybe I created the branch incorrectly?), Then fixing git to create the branch has two parents: one at the top of the tree at the time I created a branch (incorrectly, since I am forked from the previous revision) and one in the (expected) previous revision.
This "second parent" causes all kinds of grief for me, since now I am trying to merge with another branch to a new branch, and the idea of a common ancestor git is wrong.
I found this question that explains how to get the git branch to have the correct parent using rebase. The problem is that rebase only affected my local HEAD branch, not the remote binding to the git-svn repository. This would usually be very bad, but since I'm the only one using this git-svn repository, I don't care: I just want to move the remote branch to the adjusted commit.
So my question is: now that I have a parent for the local branch that points to the correct commit with which it branches, is there a way to move the remote branch to the same HEAD so that I can (for example) start git svn rebasewithout getting confused? (I'm afraid that if I manually change it, the file .git/refs/remotes/<mybranch>/.rev_map...will no longer match SVN ...?)
. , , , . , , :
$ git branch
* git_mysvnbranch
git_releasebranch
master
$ git branch -r
trunk
mysvnbranch
releasebranch
, , mysvnbranch , , . releasebranch mysvnbranch, , . gitk, :
o [git_mysvnbranch] [remotes/mysvnbranch]
|\ <--- bad pointer here
| o [remotes/trunk]
| |
| o
| | o [git_releasebranch] [remotes/releasebranch]
| | |
| o o
| |/
| o
| |
| o
| |
| o
|/
o [arbitrary branch point]
, , [remotes/releasebranch]. rebase, :
o [git_mysvnbranch]
|
| o [remotes/mysvnbranch]
| |\ <--- bad pointer here
| | o [master] [remotes/trunk]
| | |
| | o
| | | o [git_releasebranch] [remotes/releasebranch]
| | | |
| | o o
| | |/
| | o
| | |
| | o
| | |
| | o
| |/
|/
o [arbitrary branch point]
git [remotes/mysvnbranch] , [git_mysvnbranch].
, : svn . :
$ git svn rebase -n
Remote Branch: refs/remotes/mysvnbranch
SVN URL: svn://subversionrepo/branches/mysvnbranch
, , . , .
2. . git svn rebase , , git.