git-svn: Cannot setup tracking information; starting point is not a branch

后端 未结 4 1099
南旧
南旧 2020-12-05 10:24

In git 1.7.9.5 I could run the following lines without error:

export SVNPASS=readonly
git clone git@github.com:dtenenbaum/RGalaxy.test.git
cd RGalaxy.test/
g         


        
相关标签:
4条回答
  • 2020-12-05 10:59

    I am using this: git branch --set-upstream remotes/git-svn

    0 讨论(0)
  • 2020-12-05 11:15

    This is not considered as a bug by git-svn developpers. As a matter of fact, this is a result of a bug fix in v1.8.3.2. Setting up your local local-hedgehog to track git-svn's hedgehog will no longer work.

    From now on, simply doing

    git checkout -b hedgehog remotes/hedgehog
    

    is enough to be able to do all your usual git-svn operations (git svn rebase, git svn dcommit, etc.).

    Here is the explanation by Johan Herland:

    Prior to v1.8.3.2 this still sort-of works (as you observe below), because the code fails to realize the remote is invalid, and falls back to setting branch.feat-bar.remote = "." (i.e. the current repo). This might seem like an ok practice until you realize that a "git push" back to that invalid upstream would happily overwrite refs/remotes/(mirror/)feat-bar, and thus break git-svn's internal state.

    This bug was fixed in v1.8.3.2, more specifically 41c21f22 (branch.c: Validate tracking branches with refspecs instead of refs/remotes/*), and you can read more about the rationale in that commit message.

    The end result for you is that setting up your local feat-bar to track git-svn's feat-bar will no longer be accepted once you upgrade to >= v1.8.3.2. The correct way to set up a local feat-bar branch to work on top of git-svn's feat-bar is instead to forgo the upstream relationship and simply do "git checkout -b feat-bar refs/remotes/(mirror/)feat-bar".

    If you want more details, I suggest reading his whole post.

    0 讨论(0)
  • 2020-12-05 11:19

    In SourceTree, simply remove the checkbox ticked with "local branch should track remote branch".

    0 讨论(0)
  • 2020-12-05 11:19

    there are many proposed fixes for this issue:

    https://github.com/nirvdrum/svn2git/issues/132
    https://github.com/nirvdrum/svn2git/pull/145

    in my opinion this is a bug in svn2git

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