当前位置:   article > 正文

git修改commit日志_gitee修改提交日志

gitee修改提交日志

由于公司对版本提交日志进行检查,如果不符合要求,则push失败。

以下是修改commit日志的方法:

1.进入到提交代码文件所在目录,即git所在目录下

cd app-repository

2.git log

  1. git log
  2. commit bf29e3e5e799d364fe2975677baf18c9186a242c
  3. Author: ruiliu <ruiliu@asiainfo.com>
  4. Date: Fri Aug 4 10:09:51 2023 +0800
  5. [tag]:[tag新版本]
  6. commit c9e7d47d00562facdaae10882610723ee8f5c1f0
  7. Author: ruiliu <ruiliu@asiainfo.com>
  8. Date: Wed Aug 2 23:10:49 2023 +0800
  9. update
  10. Merge remote-tracking branch 'origin/master'

3.发现是,第2条,不符合规范,导致后来符合规范的提交也提交不上去

执行 git rebase -i HEAD~2

  1. # git rebase -i HEAD~2
  2. Stopped at c9e7d47... update
  3. You can amend the commit now, with
  4. git commit --amend
  5. Once you are satisfied with your changes, run
  6. git rebase --continue

进入到rebase流程。

按照提示的流程继续执行

4.git commit --amend

  1. # git commit --amend
  2. [detached HEAD f0eccc8] [tag]:[新版本]
  3. 1 file changed, 10 insertions(+)

会显示很多命令,我们是要修改,所以将命令参数改为  e 

5.git rebase --continue

  1. git rebase --continue
  2. # Successfully rebased and updated refs/heads/master.

6.git log 再次查看,已经修改完成

  1. git log
  2. commit 82856b8b9139d51384eabb073e3e1a46c3824b69
  3. Author: ruiliu <ruiliu@asiainfo.com>
  4. Date: Fri Aug 4 10:09:51 2023 +0800
  5. [tag]:[新版本]
  6. commit f0eccc89e2083987fe812f72e1b099df4dd9eeaf
  7. Author: ruiliu <ruiliu@asiainfo.com>
  8. Date: Wed Aug 2 23:10:49 2023 +0800
  9. [tag]:[新版本]
  10. Merge remote-tracking branch 'origin/master'

7.重新push下,即可

  1. # ./git-auto-commit-total.sh
  2. git pull no1
  3. From http://哈哈哈哈哈哈哈app-repository
  4. * branch HEAD -> FETCH_HEAD
  5. Already up-to-date.
  6. 正在做哈哈哈哈的提交操作
  7. [master f1af787] [tag]:[修改页面格式]
  8. 1 file changed, 10 insertions(+)
  9. # On branch master
  10. nothing to commit, working directory clean
  11. Counting objects: 15, done.
  12. Delta compression using up to 16 threads.
  13. Compressing objects: 100% (12/12), done.
  14. Writing objects: 100% (12/12), 1.06 KiB | 0 bytes/s, done.
  15. Total 12 (delta 9), reused 0 (delta 0)
  16. To http://哈哈哈哈app-repository.git
  17. 91d1505..f1af787 master -> master
  18. 完成哈哈哈哈的提交操作
  19. =======================================================

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/466711
推荐阅读
相关标签
  

闽ICP备14008679号