[英]When git svn dcommit can be used?
我想学习如何在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”,什么时候不能使用? 我显然缺少此信息,因此无法在google或手册页中找到更多描述。
dcommit时,您不能有任何未提交的更改。
要临时隐藏您的修改,请使用git stash
。 然后使用git svn dcommit
提交,最后使用git stash pop
存储,以再次启用您的修改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.