有办法从以后的提交中更改消息:
git commit --amend # for the most recent commit
git rebase --interactive master~2 # but requires *parent*
Run Code Online (Sandbox Code Playgroud)
如何更改第一次提交(没有父级)的提交消息?
我刚刚第一次重写了我的一个repos的历史(使用git-filter-branch).问题是repo有几个标签,重写之后似乎与结果历史完全断开.我认为这是因为与标签相关的历史记录没有被重写,所以他们必须指向旧的提交.那么,我可以做些什么来"应用"新历史上的标签.一点点ASCII艺术,也许更容易理解我的问题:
原始回购:
+ HEAD
|
|
+ TAG 0.2.0
|
|
+ TAG 0.1.0
|
|
+ Initial commit
Run Code Online (Sandbox Code Playgroud)
报告gitk --all重写后报告的回购结构:
+ HEAD
|
|
|
|
|
|
|
|
+ Initial commit
+ HEAD
|
|
+ TAG 0.2.0
|
|
+ TAG 0.1.0
|
|
+ Initial commit
Run Code Online (Sandbox Code Playgroud)