git rebase 合并多次提交

压缩多次合并

git rebase -i head~X

pick ecb8520 处理器问题修复
pick b4ad913 修改调过目录问题
pick 437fc9c 修复重复处理的问题
pick dacae2b 修复重复处理的问题
pick 1998c0d 修复重复处理的问题
pick c783195 加入监控
pick 3258202 加入监控
pick 4d6aba4 重构流模块
pick 57f58d0 加入监控
pick 4c3f3a4 刘列表加入优先队列
pick d0e4838 刘列表加入优先队列
pick 13dde61 流列表加入优先队列
pick 896bdb6 修复ack
pick 6eb6c68 修复ack 修复流列表
pick d24f16c 修复router 客户端close的内存错误
pick b92b408 Fix: stop pipeline when config is empty (#330)
pick 8f5a635 Fix: ignore file error in main.go (#331)
pick bee0aba fix fields (#337)
pick 343a923 Fix: sort source and interceptor when reload, related to https://github.com/loggie-io/loggie/pull/317 (#336)
pick 1b6bc2d Fix: missing extra args in transformer interceptor, related to https://github.com/loggie-io/loggie/pull/317 (#338)
pick 1e0debd Fix: do not update events in action print() of transformer interceptor (#339)
pick 9e45dab Feat: add schema interceptor (#340)
pick 2145c29 Feat: support collect log files from pod pv (#341)
pick c5fade0 Feat: support dynamic container logs (#334)
pick 0943b86 fix: ack stop block (#335)
pick e61a5bd Put the encoding conversion module in the source (#344)
pick 8c629b4 修复filestream模块在k8s里的服务发现
pick 8c5855c 修复filestream模块在k8s里的服务发现
pick bd934cf 修复kubeevent重复问题
pick 1749698 在open之前检查文件系统信息
pick a43a79e 在open之前检查文件系统信息
pick e16f445 在open之前检查文件系统信息
pick 84ef0f0 Fix: stop pipeline when config is empty (#330)
pick 7002276 Fix: ignore file error in main.go (#331)
pick 71daf0e fix fields (#337)
pick a89e423 Fix: sort source and interceptor when reload, related to https://github.com/loggie-io/loggie/pull/317 (#336)
pick 1bf686a Fix: missing extra args in transformer interceptor, related to https://github.com/loggie-io/loggie/pull/317 (#338)
pick 60d933c Fix: do not update events in action print() of t

使用squash压缩:

# Rebase 6a8dcf2..d23d141 onto 6a8dcf2 (282 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
#                    commit's log message, unless -C is used, in which case
#                    keep only this commit's message; -c is same as -C but
#                    opens the editor
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# .       create a merge commit using the original merge commit's
# .       message (or the oneline, if no original merge commit was
# .       specified); use -c <commit> to reword the commit message
#
# 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.

比如:

s 859918d fix: file source stop fail (#40)
s 80eab5a chore: log fmt (#42)
s ef6343d Fix: map concurrent write and read in listener (#43)

直接把pick 改成s 然后:wq保存退出

突出后,撤销rebase

git rebase --abort

继续rebase:

git rebase --continue

继续编辑

git rebase --edit-todo

压缩完成后,直接使用

git rebase --continue 

然后提交代码push 就可以

如果我们要看一下两个分支差异,去找到回退到哪个节点,可以

 git show-branch upstream/main tmp

git 命令行解决冲突可以用

sudo apt install kdiff3

猜你喜欢

转载自blog.csdn.net/qq_32783703/article/details/126649608
今日推荐