Can different git-svn clones of the same svn repository expect to be able to share changes then git svn dcommit?

后端 未结 7 1187
遥遥无期
遥遥无期 2020-12-07 11:23

I\'ve read a great deal of \"go from svn to git\" and other \"git-svn workflow\" articles on the web, and still I think they often deal with overly simple situations. They a

相关标签:
7条回答
  • 2020-12-07 12:11

    I've been experimenting a lot with this lately, and think I managed to come up with a setup that somewhat works. Yes, it's a strict rebase-only regime, yes it's complicated, but you do get to use Git for working locally (speed, history, stash, index, etc).

    You can use branches behind the scenes when you collaborate with other Git users in your team I think, but haven't personally experimented too much with this. As long as you linearize the log before dcommitting it should work.

    Here's the short version (repeats a lot what's been already said):

    1. Clone the Subversion repo into a "fetching" repo on a central server
    2. Init a "bare" repo on the same server
    3. Push from the fecthing repo to the bare repo
    4. Have developers clone the bare repo and then
      1. git svn init svnurl to configure the git-svn remote, and
      2. git update-ref refs/remotes/git-svn refs/remotes/origin/master so git-svn has a pointer to a revision
    5. Automatically (commit hook) have the "fetching" repo svn rebase, and push to the bare repo
    6. Developers pull from the bare repo with git pull --rebase
    7. Developers running git svn dcommit first have to repeat the update-ref above in case of newer revisions coming from SVN.

    There's an illustration of the workflow on this page (I need more reputation points before I can inline the image). Update: Here we go:

    0 讨论(0)
提交回复
热议问题