What are the best practices for use of
The merge request page on gitlab is suggesting to use 'git merge --no-ff'.
I am looking for best practices on when to use --no-ff, but I am having difficulty to find a good explanations on the best-practices aspect. The git merge tutorials I found do not mention --no-ff.
Any suggestions?
According to the documentation --no-ff:
Create a merge commit even when the merge resolves as a fast-forward. This is the default behaviour when merging an annotated (and possibly signed) tag.
There is a list of all of the commands at:
https://git-scm.com/docs/git-merge
This was also answered at:
What is the difference between `git merge` and `git merge --no-ff`?
The use of --no-ff on merge is how GitLab and GitHub do their merges for pull requests / merge requests. This gives you a single commit sha that can be reverted to revert a PR/MR. See: https://git-scm.com/blog/2010/03/02/undoing-merges.html (the last paragraph also points out using --no-ff)
Essentially, best practice is to use them when merging feature branches, merge requests, pull requests. When merging codelines, say merging master into a release line, or pulling a patch line back down into master, you would probably not bother with --no-ff and let it be fast-forward if it can.
链接地址: http://www.djcxy.com/p/45080.html上一篇: 无法同步此分支
下一篇: 什么是使用的最佳实践