当前位置: 首页 > news >正文

git修改commit日志

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

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

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

cd app-repository

2.git log

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

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

执行 git rebase -i HEAD~2

# git rebase -i HEAD~2
Stopped at c9e7d47... update
You can amend the commit now, withgit commit --amendOnce you are satisfied with your changes, rungit rebase --continue

进入到rebase流程。

按照提示的流程继续执行

4.git commit --amend

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

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

5.git rebase --continue

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

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

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

7.重新push下,即可

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

http://www.lryc.cn/news/108189.html

相关文章:

  • Qt之qml和widget混合编程调用
  • 深度学习torch基础知识
  • 【JAVA】正则表达式是啥?
  • 网络安全之原型链污染
  • 【腾讯云Cloud Studio实战训练营】使用Cloud Studio迅捷开发一个3D家具个性化定制应用
  • 【计算机网络】第四章 网络层(一)
  • Elasticsearch删除文档
  • MySQL数据库如何实现AX规范
  • mac安装nvm
  • 使用 ckeditor gem
  • Windows环境下Node.js二进制版安装教程
  • Spring中的注解装配
  • 深度优先搜索|130, 200
  • go-resty
  • 香港服务器速度不稳定的原因有哪些
  • 企业架构NOSQL数据库之MongoDB
  • 鸟哥马哥共叙Linux发展
  • OpenCV中常用算子
  • Android 11.0 系统限制上网系列之iptables用IOemNetd实现app某个时间段禁止上网的功能实现
  • 【JavaSE】面向对象编程思想之继承
  • Golang make和new的区别
  • (前后端交互式)Ajax上传图片 + 更换背景图片
  • 自媒体常见玩法
  • 【react】react生命周期钩子函数:
  • CRM系统哪些功能可以个性化定制?
  • 51单片机(普中HC6800-EM3 V3.0)实验例程软件分析 实验二 LED闪烁
  • PaperEdge 文档图像矫正
  • 入门NLTK:Python自然语言处理库初级教程
  • Android 死机问题学习笔记
  • 企业内网终端安全无客户端准入控制技术实践