美文网首页
git commit --amend两种用法

git commit --amend两种用法

作者: 欧德朗 | 来源:发表于2018-08-21 13:54 被阅读0次

2018-08-21
一、如果已经push到远端服务器,想修改已经提交过的commit信息
1.保存:Ctrl + o; 回车 ;退出:Ctrl + x

git commit --amend

2.重新提交gerrit审批

git push --no-thin origin HEAD:refs/for/master

二、如果已经push到远端服务器,有漏掉的test.txt文件想提交到上一次的commit信息
1.添加test.txt

git add test.txt

2.修改commit信息;保存:Ctrl + o; 回车 ;退出:Ctrl + x

git commit --amend

3.重新push到远端服务器

git push --no-thin origin HEAD:refs/for/master

参考网址:https://blog.csdn.net/u010164190/article/details/78121718

相关文章

网友评论

      本文标题:git commit --amend两种用法

      本文链接:https://www.haomeiwen.com/subject/qgadiftx.html