修复git-svn“文件或目录已过期;请尝试更新”

时间:2012-11-28 14:07:58

标签: svn version-control git-svn

我正在使用git svn继续在本地使用Git,但是远程推送更改到SVN服务器。

我在git svn fetch之前做了git svn dcommit

但是,现在后一个命令返回

Merge conflict during commit: File or directory 'src/path/to/Images' is out of date; try updating: resource out of date; try updating at /usr/libexec/git-core/git-svn line 939

我正在使用终端应用程序。

关于我能做什么的任何想法?感谢。

2 个答案:

答案 0 :(得分:3)

尝试使用:

git svn rebase

而不是

git svn fetch

准备您的代码以提交给SVN。 Subversion只能接受新的提交,因此git-svn必须安排你的更改,以便它们是SVN的一系列新变化,你需要为此进行重组。

答案 1 :(得分:0)

有趣的是,如果一个人有两个遥控器,比如说upstreamorigin,就会发现差异发生在分支跟踪的遥控器上。

git push <tracking remote> <branch>
git svn dcommit

为我工作。

我认为它会与我的upstream产生差异,但事实并非如此。它与origin不同,因为这是分支默认跟踪的远程。