簡體   English   中英

git svn master to branch to master - 仍然嘗試提交到分支

[英]git svn master to branch to master - still tries to commit to branch

我關注了這篇關於如何使用 git svn 創建和簽出分支的帖子,以便該分支實際上是在 svn 存儲庫上創建的。 這很好用。

完成分支后,我在 master 上進行了結帳並進行了 git 合並。 這工作得很好。 然后我將合並提交回 svn 存儲庫上的主干,因此發出 git svn dcommit。

它試圖提交給分支。 即使我現在已經檢查了主分支。 我錯過了什么?

$ git svn branch -m "test branch" test_branch
$ git checkout --track -b test_branch remotes/test_branch
$ Hack hack hack...
$ git svn dcommit --dry-run    # Make sure you're committing to the right SVN branch
$ git svn dcommit              # Commit changes to "test_branch" branch in SVN
$ git checkout master
$ git merge test-branch
$ git svn dcommit # why is this committing to the branch instead of trunk??

這是 my.git/config 以防萬一

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[svn-remote "svn"]
    url = mysvnrepos.com/svn/project
    fetch = trunk:refs/remotes/git-svn
    branches = branches/*:refs/remotes/*
[branch "test_branch"]
    remote = .
    merge = refs/remotes/test_branch

我以為有人已經問過這個了,但我再也找不到了。 無論如何,帶有分支的 git-svn 很復雜。 您必須在 svn 端創建空分支,使用git svn branch或普通svn mkdir 然后,您使用 git 檢查這些分支,並在不使用 git 級合並的情況下在它們之上重新提交提交。 這樣,git 分支在其祖先中指示了正確的 svn 分支,並且 dcommit 提交到正確的分支。 您可以驗證分支 git-svn 是否承諾使用git svn info

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM