我正在运行 --tree-filter
以便将几个具有历史记录的目录移动到另一个存储库。我想在提交消息中附加一行,比如
(Imported from ProjectA rev 684fa3....)
包括原始项目中相应提交的 SHA。
我该怎么做?
最佳答案
The original sha's available in $GIT_COMMIT
:
git filter-branch --msg-filter 'cat; echo rewritten from $GIT_COMMIT' master
关于git - 在执行git filter-branch --tree-filter 时,如何将原始commit SHA 添加到commit message 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23500089/