xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

git 强制提交 & 覆盖 origin/master

git 强制提交 & 覆盖 origin/master

git 强制提交本地分支覆盖远程分支


# git push origin 分支名 --force

# local
$ git push origin master --force

# remote
$ git push origin/master -f

origin master & origin/master

https://stackoverflow.com/questions/18137175/in-git-what-is-the-difference-between-origin-master-vs-origin-master

https://www.javatpoint.com/git-origin-master


git强制修改注释

https://www.cnblogs.com/davidgu/p/10373342.html

  1. 命令行进入项目根目录

  2. 执行命令:

    $ git commit --amend
  1. 进入vi, 修改注释,然后wq!保存

  2. 再次推送代码


posted @ 2020-02-11 14:49  xgqfrms  阅读(757)  评论(1编辑  收藏  举报