如何查看已经检查到git中,但尚未通过dcommit提交给svn? [英] How to see what has been checked into git, but hasn't been committed to svn via dcommit?
问题描述
我正在使用git-svn。我怎么能得到我已经提交到git的列表,但自从上一次 git svn dcommit
以来还没有提交到SVN存储库?也就是说,如果我做了一个dcommit,我该如何验证即将发送的内容?
git svn dcommit
来说,干运行选项对于准确找出将要提交给Subversion的内容非常有用。特别是它具有以下属性: - 它实际上并没有向Subversion提交任何内容
- 它告诉你将在Subversion中创建新版本的计算差异
- 它会告诉你Subversion中的哪个分支将被提交 - 这有时并不明显,因为它取自在第一个祖先中指定的Subversion分支在其提交消息中提交了一个git-svn-id
总的来说,在考虑使用
dcommit
之前做git svn rebase
,这样你的历史就会线性化 - 否则合并提交可能会失败在Subversion历史上有很多意义。 (如果你已经这样做了,那么git log
和gitk --all
也基本相同,但是我认为git svn dcommit --dry-run
可以让你更准确地了解即将发生的事情,即使它更难解释。)I'm using git-svn. How can I get a list of what I've committed into git, but haven't yet committed to the SVN repository since the last
git svn dcommit
? That is, how can I verify what is about to be sent if I do a dcommit?解决方案The
--dry-run
option forgit svn dcommit
is very useful for finding out exactly what will be committed to Subversion. In particular that has the properties that:- It doesn't actually commit anything to Subversion
- It tells you which diffs will be calculated to create new revisions in Subversion
- It tells you which branch in Subversion you will be committing to - this is sometimes non-obvious, since it is taken from the Subversion branch specified in the first ancestor commit with a git-svn-id in its commit message
In general it's a good idea to do
git svn rebase
before even thinking about usingdcommit
, so that your history is linearized - otherwise merge commits may not make much sense in the Subversion history. (If you've done that, thengit log
andgitk --all
will also be essentially equivalent, but I thinkgit svn dcommit --dry-run
gives you a more accurate picture of what's about to happen, even if it's more difficult to interpret.)这篇关于如何查看已经检查到git中,但尚未通过dcommit提交给svn?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!