|
virusdefenderOct 23, 2023
1
用 rebase ,gitlab 之类的都有选项可以调
|
|
vincent20Oct 23, 2023
2
rebase
|
|
virusdefenderOct 23, 2023
3
gitlab 的选项
Merge method Determine what happens to the commit history when you merge a merge request. How do they differ? Merge commit Every merge creates a merge commit. Merge commit with semi-linear history Every merge creates a merge commit. Merging is only allowed when the source branch is up-to-date with its target. When semi-linear merge is not possible, the user is given the option to rebase. Fast-forward merge No merge commits are created. Fast-forward merges only. When there is a merge conflict, the user is given the option to rebase. |
|
MENGKEOct 23, 2023
4
git merge xxx --no-ff
|
|
PlutoooOct 23, 2023
6
rebase + 1
|
|
DOOMSOct 23, 2023
7
rebase
|
|
0x2CAOct 23, 2023
8
对于 git 的操作应该是 merge 而不是 rebase ,对于任何的操作应该都需要记录,如果你使用 rebase ,实际上你操作了,提交的 commit 不一定是你要提交的,想退回会比较困难,如果你不想要看见这样的记录,可以自定义 commit 信息,但是一定要有这个 commit
|
|
wu67Oct 23, 2023
9
git log --no-merges
|
|
victimsssOct 23, 2023
10
虽然平常都是 rebase ,然而我更喜欢 merge 的做法。
|
|
zxf4399Oct 23, 2023
11
git merge --ff-only <branch>
|
|
pkoukkOct 23, 2023
12
多人协作的时候,这条 merge 记录是有意义的,它代表由谁审核过了这个 merge ,并允许合并的
例如,开发这个项目的有 2 个 maintainer A ,B ,功能由 developer C 开发 那合并记录就能看出来,功能的 commit 是 C 做的,如果 merge commit 是 A ,说明是 A review 之后合进来的 |
|
shawndevOct 23, 2023
13
--ff-only
|
|
cutiechiOct 23, 2023 via iPhone
14
fast forward
|
|
adoniOct 23, 2023
15
在本地使用 rebase
在远端(网页上 merge 的时候)使用 fastforward |
|
unco020511Oct 23, 2023
17
gitlab Fast-forward merge
文档:https://docs.gitlab.com/ee/user/project/merge_requests/methods/#fast-forward-merge |
|
sycwikiOct 23, 2023
18
rebase/cherry-pick
|
|
nothingistrueOct 23, 2023
19
merge branch xx into xx 是一条正式 Git 提交,你要是去了,你会被打死,谨记。
|
|
nothingistrueOct 23, 2023
20
如果你不想让出现 merge branch feature_x into deveop 的提交,那么你需要调整的是修改 merege request 的执行合并的方式,让起实质上只能是压缩提交,或者快速合并。但之前已经做过的,是不能改的。
压缩提交方式,会将待合并分支的所有提交先压缩成一个提交,一般不建议这么做,严重丢失历史。 快速合并有前提的,两个分支开叉的地方,必须是主分支的 Head ,即实际上主分支原地没动,只有待合并分支生成了新内容。要么你需要外部限定一次只能有一个开发分支(这就不存在分布式开发了,实际上连 SVN 都不算,直接回到了 VSS 时代的先锁定后修改方式)。要么得借助于然 rebase ,待合并分支先变基,然后再往主分支合并(这就类似于 SVN 方式了)。并且,你还得配置 merege request 的执行方式是 --ff-only 。 |
|
tusjOct 23, 2023
21
git pull -r
|
|
nothingistrueOct 23, 2023
22
merge branch xx into xx 正好跟外部文档上的 merge request 一一对应,是一条非常有用的提交。安心留着吧。
|
|
ilovey482iOct 23, 2023
23
我很好奇,为啥楼为啥要去掉这个呢?
|
|
leteOct 23, 2023
24
@ilovey482i #23 看着难受
|
|
kiroryOct 23, 2023
25
grep -v 'merge branch'
|
|
nightwitchOct 23, 2023
26
|
|
duanxianzeOct 23, 2023
27
根据我的实际经验,不要有这种洁癖,难看总比出问题要好
|