从 Subversion 迁移到 Git 如何找到给定修订号的提交?

发布于 2024-09-04 08:14:27 字数 173 浏览 4 评论 0原文

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

问题跟踪器出现以下评论是很常见的: “已在 r12345 中修复”。

鉴于此,我希望能够提取与 r12345 相对应的差异。

提前致谢。

问候

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.

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

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

Thanks in advance.

Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

左耳近心 2024-09-11 08:14:27

给定修订号,您可以找到 Git SHA,

git svn find-rev r1938

我不知道是否有一种“一次性”方式来获取提交或其他任何内容,但您可以编写类似“

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

更新”的内容:请注意,您还可以获取提交消息 再次更新

git svn log -r 1938

:请注意,find-rev 也可以反向工作:

git svn find-rev c7443021942

返回 SVN 提交号。

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

Update again: note that find-rev also works in reverse:

git svn find-rev c7443021942

returns the SVN commit number.

嘿看小鸭子会跑 2024-09-11 08:14:27

对于 Git 来说是类似的:

Fixed in d8602bb9729ddb2f28e61028cc5981cb310231a2.

获取差异:

git show d8602bb9729ddb2f28e61028cc5981cb310231a2

With Git it’s similar:

Fixed in d8602bb9729ddb2f28e61028cc5981cb310231a2.

Get the diff with:

git show d8602bb9729ddb2f28e61028cc5981cb310231a2
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文