从旧的SVN仓库签出对应于某个修订版的git commit? [英] Checkout the git commit corresponding to a certain revision from the old SVN repository?
问题描述
我将我的存储库从SVN迁移到git。我用
这个网站。现在我在修订X中有一个错误。如何从我的git存储库结算,只知道我的旧SVN回购的修订号?
感谢您的帮助。
你可以找到与 git svn find-rev对应的Subversion版本的git commit
子命令。例如,如果你正在寻找对应于Subversion版本3431的提交,你可以这样做:
$ git svn find- rev r3431
42ed8bcf690fd0c655c5cee91b09258318fc56e8
然后,要检出该版本,只需使用第一行,例如如果是:
commit 42ed8bcf690fd0c655c5cee91b09258318fc56e8
作者:torstenrohlfing< torstenrohlfing @ 42a5c34f-2066-0410-bec5-ba365beb4995>
日期:星期五9月9日17:11:38 2011 +0000
修正:不更新预先存在的未更新文件的时间戳。
git-svn-id:https://www.nitrc.org/svn/cmtk/trunk@3431 42a5c34f-2066-0410-bec5-ba365beb4995
code>
您可以这样做:
git checkout 42ed8bcf69
...尝试修改。 (请注意,这将分离HEAD,因此如果您不知道这是什么意思,那么首先应该搜索detached HEAD:))
I migrated my repository from SVN to git. I used THIS site. Now I have a bug in revision X. How do I checkout from my git repository, knowing only the revision number from my old SVN repo?
Thank you for your Help.
You can find the git commit that corresponds to the Subversion revision with the git svn find-rev
subcommand. For example, if you're looking for the commit that corresponds to Subversion revision 3431 you can do:
$ git svn find-rev r3431
42ed8bcf690fd0c655c5cee91b09258318fc56e8
Then, to checkout that revision, just use the object name from the first line, e.g. if it's:
commit 42ed8bcf690fd0c655c5cee91b09258318fc56e8
Author: torstenrohlfing <torstenrohlfing@42a5c34f-2066-0410-bec5-ba365beb4995>
Date: Fri Sep 9 17:11:38 2011 +0000
FIX: do not update time stamps on pre-existing files that did not get updated.
git-svn-id: https://www.nitrc.org/svn/cmtk/trunk@3431 42a5c34f-2066-0410-bec5-ba365beb4995
You can do:
git checkout 42ed8bcf69
... to try that revision. (Note that this will detach HEAD, so if you don't know what that means, it would be worth searching for "detached HEAD" first :))
这篇关于从旧的SVN仓库签出对应于某个修订版的git commit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!