从 Subversion 迁移到 Git 如何在给定修订号的情况下找到提交? [英] Migrating from Subversion to Git how can I find a commit given a revision number?

查看:37
本文介绍了从 Subversion 迁移到 Git 如何在给定修订号的情况下找到提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 svn2git(内部使用 git-svn)从 Subversion 迁移到 Git 我想知道如何找到特定的修订提交.

Migrating from Subversion to Git using svn2git (which internally uses git-svn) I'd like to know how I can find a specific revision commit.

问题跟踪器有如下评论是很常见的:已在 r12345 中修复".

It is quite common to have issues tracker to have comments like: "Fixed in r12345".

鉴于此,例如,我希望能够提取与 r12345 对应的差异.

Given this, I'd like to be able, for example, to extract the diff corresponding to r12345.

提前致谢.

问候

推荐答案

给定版本号,你可以找到 Git SHA

Given the revision number, you can find the Git SHA with

git svn find-rev r1938

我不知道是否有一种一次性"的方式来获得提交或任何东西,但你可以写类似的东西

I don't know if there's a "one-shot" way to get the commit or anything, but you can write something like

git log -p `git svn find-rev r1938`

<小时>

更新:请注意,您也可以使用


Update: note that you can also grab the commit message with

git svn log -r 1938

<小时>

再次更新:注意 find-rev 也可以反向工作:

git svn find-rev c7443021942

返回 SVN 提交号.

returns the SVN commit number.

这篇关于从 Subversion 迁移到 Git 如何在给定修订号的情况下找到提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆