How do I make git-svn use a particular svn branch as the remote repository?

后端 未结 4 1227
面向向阳花
面向向阳花 2020-12-07 09:52

A word of warning: I\'m a n00b to git in general. My team uses feature branches in svn, and I\'d like to use git-svn to track my work

相关标签:
4条回答
  • 2020-12-07 10:34

    You might also have a look at this: git-svn is a gateway drug - robby on rails.

    I used something like this when I needed to make sure that my local branch was pointing to the correct remote svn branch:

    git branch -r
    

    to get the name of the remote branch I want to be tracking. Then

    git reset --hard remotes/svn-branch-name
    

    to explicitly change my local branch to point to a different remote branch.

    0 讨论(0)
  • 2020-12-07 10:43

    I use git-svn but I haven't used the features that interoperate with SVN branches. Having said that, I notice that the tutorial you were following didn't use the -T, -b, -t options to git svn init. These options tell git-svn what the upstream trunk/branches/tags directories are named, which might be important in your situation.

    0 讨论(0)
  • 2020-12-07 10:44

    I needed to run 'git svn fetch' first, since the branch I wanted to associate with had been created after my git client.

    0 讨论(0)
  • 2020-12-07 10:53

    Muchas gracias to Bart's Blog for this handy reference for svn branches in git. Apparently all I needed was to specify a remote branch when creating the git branch, e.g.,

    git checkout -b git-topic-branch-foo foo
    

    where foo is the name of the remote branch.

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