第一:切换分支
git checkout sit_20190729_zhangkezhi_yinhangka4
第二:看最近提交记录
git log --oneline -10
第三:合并最近十条提交
git rebase -i head~10

6
7 # Rebase bdc90489..ccc5859a onto bdc90489 (5 commands)
8 #
9 # Commands:
10 # p, pick <commit> = use commit
11 # r, reword <commit> = use commit, but edit the commit message
12 # e, edit <commit> = use commit, but stop for amending
13 # s, squash <commit> = use commit, but meld into previous commit
14 # f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
15 # commit's log message, unless -C is used, in which case
16 # keep only this commit's message; -c is same as -C but
17 # opens the editor
18 # x, exec <command> = run command (the rest of the line) using shell
19 # b, break = stop here (continue rebase later with 'git rebase --continue')
20 # d, drop <commit> = remove commit
21 # l, label <label> = label current HEAD with a name
22 # t, reset <label> = reset HEAD to a label
23 # m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
24 # . create a merge commit using the original merge commit's
25 # . message (or the oneline, if no original merge commit was
第四:强制提交
git push -f
第五 在git的wiki中写入你的文档

rebase
将你提交的进行合并
git config --global pull.rebase true


https://www.codercto.com/a/45325.html
click
自己的总结:
rebase两个地方需要:
一个是你合并你提交的若干commit
另一个是将你的分支合并master,因为master中有新内容!在大公司才用的到。
本文详细介绍了Git的高级使用技巧,包括如何切换分支、查看提交记录、合并提交、强制推送及在Wiki中编写文档等内容。适合有一定Git基础的开发者深入学习。
1631

被折叠的 条评论
为什么被折叠?



