$ git --version
git version 1.7.0.3
我克隆一个SVN仓库,并作出承诺:git svn dcommit总是失败,“无法用脏索引提交。”
$ git svn clone --stdlayout http://svn/example/project
$ echo test >> blah.txt
$ git commit -m "Something"
当我尝试和dcommit
回SVN,我得到以下错误:
$ git svn dcommit
Cannot dcommit with a dirty index. Commit your changes first, or stash them with `git stash'.
at .../git/1.7.0.3/.../libexec/git-core/git-svn line 497
..despite的分支似乎很干净:
$ git status
# On branch master
nothing to commit (working directory clean)
唯一的地方我ca N参看子虚乌有的“未分级的变化”是gitk
,它说:“本地提交的修改,在索引未选中”
运行git stash
允许dcommit
出于某种原因的工作:
$ git stash
No local changes to save
$ git svn dcommit
Committing to http://svn/example/project ...
M blah.txt
Committed r65913
M blah.txt
r65913 = a5547d761108d233211f115429e23ddca73bf4bc (refs/remotes/trunk)
No changes between current HEAD and refs/remotes/trunk
Resetting to the latest refs/remotes/trunk
我有一个别名运行git stash; git svn dcommit; git stash apply
- 但这不是最好的解决方法,因为它会导致使用实际使用藏匿
3年后,我遇到了同样的事情。不幸的是,情况变得更糟。 git暗藏不允许我dcommit。 – 2013-10-08 16:33:49
%git svn dcommit fatal:歧义参数'HEAD':修订版本和文件名称 使用' - '将文件名与修订版本分开 无法提交脏索引。首先提交你的修改,或者用'git stash'隐藏它们。 git-core/git-svn line 760 – 2013-10-08 16:42:14