修改歷史提交 commit 的信息
操作步驟:文章來源:http://www.zghlxwxcb.cn/news/detail-650192.html
- git rebase -i 列出 commit 列表
- 找到需要修改的 commit 記錄,把 pick 修改為 edit 或 e,:wq 保存退出
- 修改 commit 的具體信息git commit --amend,保存并繼續(xù)下一條git 4. 4. rebase --continue,直到全部完成
- 中間也可跳過或退出git rebase (–skip | --abort)
# 列出 rebase 的 commit 列表,不包含 <commit id>
$ git rebase -i <commit id>
# 最近 3 條
$ git rebase -i HEAD~3
# 本地倉庫沒 push 到遠(yuǎn)程倉庫的 commit 信息
$ git rebase -i
# vi 下,找到需要修改的 commit 記錄,```pick```修改為 ```edit```或 ```e```,```:wq```保存退出
# 重復(fù)執(zhí)行如下命令直到完成
$ git commit --amend --only -m "modify message by daodaotest"
$ git rebase --continue
# 中間也可跳過或退出 rebase 模式
$ git rebase --skip
$ git rebase --abort
https://cloud.tencent.com/developer/article/1730774文章來源地址http://www.zghlxwxcb.cn/news/detail-650192.html
到了這里,關(guān)于git修改歷史commit信息的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!