How to rebase for git svn?
Hi, I made a git svn repository from an svn repository. Then I cloned the git repository, committed some changes to the clone, and pulled back to the original repository. However, now the original repository gives me conflicts whenever I run git svn rebase. I believe this is because git pull treats the other repository's commits as a branch and merges them back instead of rebasing them and maintaining the type of linear history that is good for playing with svn. Any hints as to how to fix this? I think the solution is to undo the merge that resulted from the pull, but I don't know how to do this.
I wrote a simple script reproducing exactly what's going on (along with a transcript of its output). I tried to make it as simple as possible, but it can probably be simplified even more to reproduce the problem:
Thanks in advance for any help!
Signature · 2 lines
Yang Zhang http://www.mit.edu/~y_z/
Quoted 10 lines · Yang Zhang
Hi, I made a git svn repository from an svn repository. Then I cloned the git repository, committed some changes to the clone, and pulled back to the original repository. However, now the original repository gives me conflicts whenever I run git svn rebase. I believe this is because git pull treats the other repository's commits as a branch and merges them back instead of rebasing them and maintaining the type of linear history that is good for playing with svn. Any hints as to how to fix this? I think the solution is to undo the merge that resulted from the pull, but I don't know how to do this.
Quoted 7 lines
I wrote a simple script reproducing exactly what's going on (along with a transcript of its output). I tried to make it as simple as possible, but it can probably be simplified even more to reproduce the problem:
Thanks in advance for any help!
Hi,
Try passing --rebase or --squash with "git pull" to keep history linear for SVN.
Signature · 1 line
Eric Wong
Quoted 5 lines · Eric Wong
Quoted 1 line · Yang Zhang
Thanks in advance for any help!
Try passing --rebase or --squash with "git pull" to keep history linear for SVN.
Consider doing the following:
git config alias.repull "pull --rebase" And then using 'git repull' instead of 'git pull'.
Signature · 3 lines
Cheers, Sverre Rabbelier
Quoted 10 lines · Sverre Rabbelier
Quoted 5 lines · Eric Wong
Quoted 1 line · Yang Zhang
Thanks in advance for any help!
Try passing --rebase or --squash with "git pull" to keep history linear for SVN.
Consider doing the following:
git config alias.repull "pull --rebase" And then using 'git repull' instead of 'git pull'.
Or set branch.<name>.rebase in your config and just use "git pull" ;-) Setting branch.autosetuprebase might also be useful in that case.
You should be careful to make sure that the other side does not lag behind WRT svn, though. Otherwise, you end up rebasing commits that corresponds to svn revisions. Bad.
Björn
Quoted 10 lines · Björn Steinbrink
Quoted 8 lines · Sverre Rabbelier
Quoted 4 lines · Eric Wong
Quoted 1 line · Yang Zhang
Thanks in advance for any help!
Try passing --rebase or --squash with "git pull" to keep history linear for SVN.
Consider doing the following:
git config alias.repull "pull --rebase" And then using 'git repull' instead of 'git pull'.
Quoted 8 lines
Or set branch.<name>.rebase in your config and just use "git pull" ;-) Setting branch.autosetuprebase might also be useful in that case.
You should be careful to make sure that the other side does not lag behind WRT svn, though. Otherwise, you end up rebasing commits that corresponds to svn revisions. Bad.
Björn
git pull --rebase doesn't seem to be working either....
Signature · 2 lines
Yang Zhang http://www.mit.edu/~y_z/