作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在将我的 git 日志自定义为全部在 1 行中。具体来说,我添加了以下别名:
lg = log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%an%Creset - %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
因此,当我运行 git lg
时,我看到以下内容:
* 41a49ad - zain - commit 1 message here (3 hours ago)
* 6087812 - zain - commit 2 message here (5 hours ago)
* 74842dd - zain - commit 3 message here (6 hours ago)
但是,我也想在其中添加 SVN 修订号,所以它看起来像:
* 41a49ad - r1593 - zain - commit 1 message here (3 hours ago)
正常的 git log
会显示 SVN 修订号,所以我相信这一定是可能的。我该怎么做呢?
最佳答案
考虑命令 git svn
不过,我不确定您是否可以将这两个选项组合在一个命令行中。
一个脚本(有点像 this one 这不是您想要的,但仍然可以提供一些想法)可能是合适的。
sdaau添加 in the comments :
An example of this:
git svn find-rev $(git log --max-count 1 --pretty=format:%H)
Note that
find-rev
searches in the current branch, so if you're inmaster
andrxyz
happened in a branch,find-rev
will not find it.
You can give-B
(before) or-A
(after) options for a wider search, seegit svn find-rev
man page section.
关于git - 如何在 git log 中显示 SVN 修订号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2870506/
我是一名优秀的程序员,十分优秀!