git修改某次commit(白痴版)

第一步

在bash窗口运行 git rebase --interactive commitId^

比如要改的commitId是 abcedf

bash 复制代码
git rebase --interactive abcedf^

键盘 按 i 或者 ins 进入编辑状态 进入insert 编辑状态

在bash窗口手动把对应commit前面的pick改为e或edit

按 esc 进入退出程序

输入 :wq 保存退出

第二步

执行git commit --amend

修改commit

按 esc 进入退出程序

输入 :wq 保存退出

第三步

git rebase --continue

第四步

git push --foce-with-lease

相关推荐
Just_Paranoid21 分钟前
【Gerrit Patch】批量下载 Gerrit 提交的 Patch
git·gerrit·shell·patch
<但凡.24 分钟前
Linux 修炼:进程控制(一)
linux·运维·服务器·bash
Tipriest_11 小时前
Ubuntu 中 Bash / Zsh / Ash / Dash 的使用与区别(含对比图)
ubuntu·bash·dash
T - mars13 小时前
Pycharm中使用git
ide·git·pycharm
jason_yang15 小时前
Workspace搭建Vue3+组件分离的Monorepo项目
git·npm·前端工程化
望获linux19 小时前
【Linux基础知识系列:第一百三十九篇】使用Bash编写函数提升脚本功能
linux·运维·服务器·arm开发·chrome·性能优化·bash
liuyunshengsir19 小时前
-bash: ssh-copy-id: command not found的两种解决方法
开发语言·ssh·bash
鸽鸽程序猿19 小时前
【Git】Git 简介及基本操作
git
Lynnxiaowen20 小时前
今天我们开始学习nginx缓存功能,CORS以及nginx防盗链
linux·运维·学习·nginx·云计算·bash
X1A0RAN1 天前
在Unix/Linux中bash/sh/source以及./执行脚本的区别
linux·bash·unix