从SVN转换为Git时,如何将修订号置于提交消息中? [英] When converting from SVN to Git, how do I put the revision number in the commit message?

查看:105
本文介绍了从SVN转换为Git时,如何将修订号置于提交消息中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将把我们的版本库从Subversion转换为Git,但希望能够保留SVN版本号,因为bug跟踪器中的注释会定期引用它。



我们将使用 git svn clone John Albin的博客

有没有办法在提交信息中包含修订号?我宁愿在克隆过程中这样做,但后处理步骤是可以接受的。



是的,我知道 git svn find -rev ,但这需要SVN存储库存在,并且用户可以通过网络访问它。 p> git svn 默认情况下是这样做的:它通常在每个提交消息中包含一行,其中包含SVN修订版本号(以及其他一些数据)但是,您发布的链接是使用 - no-metadata 克隆,它告诉您 git svn 不要附加 git-svn-id 行。


We will be converting our repository from Subversion to Git, but would like to be able to retain the SVN revision number as comments in the bug tracker regularly reference it.

We will be using git svn clone and the process described in John Albin's blog.

Is there a way to include the revision number in the commit message? I'd prefer to do it during the clone, but a post-processing step would be acceptable.

Yes, I know about git svn find-rev, but that requires the SVN repository stick around and the user has network access to it.

解决方案

git svn does this by default: it normally includes a line in every commit message that has the SVN revision number (and some other data) for that commit.

However, the link you posted has you cloning with --no-metadata, which tells git svn not to append the git-svn-id line.

这篇关于从SVN转换为Git时,如何将修订号置于提交消息中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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