gpt4 book ai didi

git - 为什么 git svn 远程跟踪停止工作?

转载 作者:太空狗 更新时间:2023-10-29 13:57:16 25 4
gpt4 key购买 nike

我有以下设置

svn 仓库

application
|
|-branches
| |
| |-develop-svn
|
|-trunk

本地 git 仓库

master
|
|-develop

主轨道 Remote /后备箱

开发轨道 Remote /develop-svn

出于某种原因,develop 停止跟踪 develop-svn。

当我从 master checkout develop 时,我收到以下消息。

$ (master) git checkout develop
Switched to branch develop
Your branch is ahead of 'develop-svn' by 59 commits.

当我尝试提交到 svn 存储库时,它会尝试更新远程主干。

$ (develop) git svn dcommit -n
Committing to https://servername/svn/application/trunk ...
...

它曾经 promise https://servername/svn/application/branches/develop-svn

我已经尝试过这个命令,但没有帮助:

$ (master) git branch --set-upstream develop develop-svn
Branch develop set up to track local refs/remotes/develop-svn.
$ (master) git checkout develop
Switched to branch develop
Your branch is ahead of 'develop-svn' by 59 commits.
$ (develop) git svn dcommit -n
Committing to https://servername/svn/application/trunk ...
...

我的配置是这样的

[svn-remote "svn"]
url = https://servername/svn/application
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
tags = tags/*:refs/remotes/tags/*

最佳答案

According to Pro Git , git svn dcommit根据最近的 svn-id 决定推送到哪个 Subversion 分支在历史上。 git svn documentation解释这是通过回顾每个实例中第一个父级之后的历史来完成的:

If you do merge, note the following rule: git svn dcommit will attempt to commit on top of the SVN commit named in

       git log --grep=^git-svn-id: --first-parent -1

You must therefore ensure that the most recent commit of the branch you want to dcommit to is the first parent of the merge. Chaos will ensue otherwise, especially if the first parent is an older commit on the same SVN branch.

(我相信您会注意到,svn-id 以指向 trunksvn-develop 或其他内容的 URL 开头。)

那么,如果您在您所在的分支上尝试该命令,它会找到您期望的提交吗?或者您可能已经以某种方式重新定位或 merge ,这可能使最新的 git svn 成为可能。提交(在上述意义上)来自 trunk 的一个在 Subversion 而不是 develop-svn分支机构?

关于git - 为什么 git svn 远程跟踪停止工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5391573/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com