Git 代码的提交与取消

来源:互联网 发布:风月知相思 在线阅读 编辑:程序博客网 时间:2024/05/21 12:42

1,代码commit但是没有push,要修改 描述:
git commit --amend

进入vim: 按 i 进入编辑模式,
编辑完成后,
输入:wq! 保存退出。

2,代码已经push,已经申请合并请求了。

2.1 ,取消合并请求
2.2,git reset --soft xxxxxxxxxxxxxx //commit id
2.3 , 重新走提交流程即可

3,提交时 直接输入:git commit 进入vim编辑提交信息,可以换行**
4,代码已经提交到自己分支,回退

要先备份

git reset --hard "commit id"git push -f