我想学习如何在svn存储库中使用git。
我遵循这个手册:http://git-scm.com/book/en/Git-and-Other-Systems-Git-and-Subversion
我在我的档案里做了一些修改。其中一些是上演的,有些则不是:
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: CHANGES.txt
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: CHANGES.txt
#根据手册,我首先将分阶段的更改提交到本地存储库中:
$ git commit -m "new"
[master 21bf2bd] new
1 file changed, 1 insertion(+)现在我只有未完成的改变,我想活下去,就像为了将来的承诺一样:
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: CHANGES.txt
#
no changes added to commit (use "git add" and/or "git commit -a")我想将本地提交推到svn的上游:
$ git svn dcommit
CHANGES.txt: needs update
update-index --refresh: command returned error: 1为什么我不能这么做?
我什么时候可以使用"dcommit“,什么时候不能使用?,我显然缺少这个信息,而且我无法在谷歌或手册页中找到更多的描述。
发布于 2014-11-10 11:52:54
当你提交的时候,你不能有任何非背诵的改变。
若要暂时隐藏修改,请使用git stash。然后使用git svn dcommit提交,最后用git stash pop打开存储库,再次启用您的修改。
https://stackoverflow.com/questions/19913616
复制相似问题