$ 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