git 更改远程commit信息
来源:互联网 发布:办公软件2010 编辑:程序博客网 时间:2024/05/29 03:34
在将commit信息push到origin之后如果想更改commit信息可以使用git rebase -i 命令。具体方法如下
修改最近一次commit信息
git commit --amend
使用以上命令后,你会进入文本编辑器,修改commit信息保存后就可以更新commit信息
修改多条commit信息
例如,如果想要修改最近三次提交信息,或者那组提交中的任意一个提交信息,将想要修改的最近一次提交的父提交作为参数传递给 git rebase -i命令,即
HEAD~2^ 或 HEAD~3。
git rebase -i HEAD~3
使用上述命令后,会出现类似的界面
pick f7f3f6d changed my name a bitpick 310154e updated README formatting and added blamepick a5f4a0d added cat-file# Rebase 710f0f8..a5f4a0d onto 710f0f8## Commands:# p, pick = use commit# r, reword = use commit, but edit the commit message# e, edit = use commit, but stop for amending# s, squash = use commit, but meld into previous commit# f, fixup = like "squash", but discard this commit's log message# x, exec = run command (the rest of the line) using shell## These lines can be re-ordered; they are executed from top to bottom.## If you remove a line here THAT COMMIT WILL BE LOST.## However, if you remove everything, the rebase will be aborted.## Note that empty commits are commented out
如果你想更改第一条commit 信息,把第一条commit信息对应的pick 更改为edit然后保存退出,运行
git rebase --amend
运行上述命令后在弹出文本编辑界面重新提交commit信息,完成后保存退出。运行
git rebase --continue
所有的commit信息都修改完之后运行一下命令将更改推送到远程
git push origin master --force
git commit 信息规范
关于git commit信息规范可以参照
https://chris.beams.io/posts/git-commit/#separate
阅读全文
0 0
- git 更改远程commit信息
- Git 执行更改 git commit
- Git往远程push前修改commit信息
- Git往远程push前修改commit信息
- Git往远程push前修改commit信息
- git删除远程commit
- GIT修改commit信息
- git commit --amend 修改还未提交到远程分支的 commit 信息
- git commit –amend 修改还未提交到远程分支的 commit 信息
- git commit 提交最新更改
- git 更改远程仓库
- 更改git远程仓库
- git更改远程origin
- git 更改远程仓库链接
- 修改git commit信息中的author
- 如何写好 Git Commit 信息
- git修改已经提交的commit信息
- 怎样写好Git的commit信息
- zepto.js scrollTop方法在移动端chrome中失效的问题
- object遮挡dialog标签的解决办法
- hive系列-hive安装
- PHP访问API使用xml格式传输数据
- 使用mock进行java单元测试
- git 更改远程commit信息
- 科技楼上机远程连接放在实验室的计算机
- HTML DOM Element 对象之tagName
- hive系列-hive教程
- 百度长尾词
- 二十六、装饰器
- js的主要特点、js的运用
- 19. 快速排序
- Django框架全面讲解 -- Django Views(视图函数)