我想学习如何将 git 与 svn 存储库一起使用。
我遵循本手册: 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(+)
现在我只有 unstages 更改,我想像将来的提交一样生活:
$ 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 或man pages中找到更多描述。