Tracking upstream svn changes with git-svn and github?

后端 未结 1 896
鱼传尺愫
鱼传尺愫 2021-02-04 09:36

How do I track upstream SVN changes using git-svn and github?

I used git-svn to convert an SVN repo to git on github:

$ git svn clone -s  http://svn.osqa         


        
1条回答
  •  南旧
    南旧 (楼主)
    2021-02-04 09:58

    It looks like, with the exception of your rebase, everything happened as expected, but with a lot more verbiage that you might expect. Here's what I think I would do to create/integrate the bits on a new machine:

    1. Clone your Svn repository. Ideally, I'd like to start with the git repo because it's yours and it's in a known state, but I don't know of any way to initially pull content from Svn than to clone it. I like to add a --prefix=svn/ when cloning so that all of my remote branches from Svn are annotated as such.
    2. Add your origin (just like you've done).
    3. Create a local branch for working. git co -b local-branch svn/branchname. Now you have a nice, local area for playing with stuff.
    4. Ensure that you're on that local branch you just created (you should be).
    5. Pull from Github. You've done this correctly, but ambiguously. To clear up the ambiguity, be explicit: git pull origin master (pull from origin to the master branch).
    6. Rebase from Svn to sync everything up. git svn rebase.

    I haven't tried this, but it's a pretty typical workflow and the errors you're getting don't seem to be related to your service of two remotes (Svn and Github). They appear to be a bit more generic and related to your workflow and how you're calling the commands.

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