使用tortoisegit修改日志

这篇博客介绍了如何使用TortoiseGit工具来修改错误的Git提交信息。当提交处于当前分支头部、其他分支头部或中间位置时,分别提供了详细的修正步骤,包括切换分支、硬重置、补丁应用等操作。

http://stackoverflow.com/questions/17647936/how-do-i-edit-an-incorrect-commit-message-with-tortoisegit

 

If the commit is the head of current branch, that is easy.

  1. Context menu -> Git Commit
  2. Tick "Amend Last Commit" checkbox
  3. Correct your commit message
  4. OK

If the commit is the head of other branch, switch to that branch first.

  1. Context menu -> TortoiseGit -> Switch/Checkout
  2. Choose branch name
  3. OK
  4. Follow above 1-4 steps to amend commit message

If the commit is in the middle without any merge between head, you need to reset, amend and cherry-pick

  1. Context menu -> TortoiseGit -> Log
  2. Select the commit -> Context menu -> Reset
  3. Hard Reset (this will discard all work contained in commits above the selected commit as well as any un-committed changes in the working directory)
  4. OK
  5. Follow above 1-4 steps to amend commit message
  6. Select from head to one commit above it -> Context menu -> Cherry-pick
  7. Continue

 

分为3种情况:

第一种情况,如果需要修改的commit是当前分支的最新的一个commit,

在版本库中,右键菜单,提交

在提交的界面,选择Amend Last Commit

然后根据需要修改日志信息,包括commit message,日期,作者

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值