gitmergerequeest报500_Git使用爬坑记录

更新时间:2023-05-16 21:31:52 阅读: 评论:0

gitmergerequeest报500_Git使⽤爬坑记录主博客地址:
F嘉阳 博客b p
掘⾦地址:
F嘉阳 的个⼈主页 - 掘⾦j uejin.im
分离头指针
当前分⽀图
切换到之前的某⼀次提交
女人培训
执⾏命令
$ git checkout de11fa87ea
提⽰,当前位于“分离头指针”状态
分⽀图
注意
在分离头指针状态下没有绑定分⽀
产⽣的commit不会被保存
分⽀切换后在分⽀图中看不到该commit
⼀段时间后会被git⾃动清除
⼀段时间
使⽤场景
尝试性做⼀些变更,可以随时丢弃
此处演⽰分离头指针丢失commit的情况和补救措施
丢失commit
使⽤IDE修改⽂件并提交,忽略所有警告,修改后分⽀图如下
此时接到其他需求,需要切换分⽀进⾏紧急修复
执⾏命令
$ git checkout master
分⽀切换成功,并弹出提⽰和告警
Warning: you are leaving 1 commit behind, not connected to any of your branches: 199ac20 游离状态修改⽂件
If you want to keep it by creating a new branch, this may be a good time to do so with: git branch 199ac20
collagen
yingyusijiSwitched to branch 'master' Your branch is up to date with 'origin/master'.
dennis gabor
此时查看分⽀图,刚才的commit已经不可见
补救
此时发现刚才的commit⼗分重要,可根据git的提⽰进⾏补救
执⾏命令
$ git branch hot-fix 199ac20
再次查看分⽀图,可见commit已经恢复
jelly
本地分⽀操作
以下操作仅适⽤于本地分⽀,⽆远程分⽀协同⼯作的情况
修改当前commit的message——amend
当前分⽀图
major
执⾏命令
$ git commit --amend
kidney dia>emv⾃动弹出编辑器
修改后保存并关闭编辑器即可,输出如下
再次查看分⽀图
修改前⾯某次commit的message——reba 现计划修改如下message
使⽤IDE拷贝其⽗提交的SHA值
执⾏命令,-i表⽰交互式执⾏
$ git reba -i 199ac203c90f881024c6870d56517df9e2080841
政治大纲
⾃动弹出编辑器
同时包含提⽰操作
Reba 199ac20..bfe2b7f onto 199ac20 (3 commands)
Commands: p, pick = u commit r, reword = u commit, but edit the commit message e, edit = u commit, but stop for amending s, squash = u 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 b, break = stop here (continue reba later with 'git reba --continue') d, drop = remove commit l, label = label current HEAD with a name t, ret = ret HEAD to a label m, merge [-C | -c ] [# ] . create a merge commit using the original merge commit's . message (or the oneline, if no original merge commit was . specified). U -c to reword the commit message.
The 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 reba will be aborted.
Note that empty commits are commented out
energy meter由此可见“变基”⽀持很多操作,此处需要使⽤的是reword,修改⽬标提交的命令为r
保存并关闭编辑器,会⾃动弹出新编辑器界⾯

本文发布于:2023-05-16 21:31:52,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/111127.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

上一篇:svn的常用命令
下一篇:常用商务英语
标签:指针   编辑器   修改   状态
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图