Feature branch with or without fast forwarding?

I have been using git for a long time. But I've never used it together. I am currently creating a new project and planning a lot of things, among others: how is git?

Okay, so I started reading a bit and there was a simple solution to say, “Okay, we'll be using a feature workflow. This is awesome.

The next question is: merger or PR? Merging! Good.

Last question: FF or non-FF?
Does it make sense to merge FF into a branch workflow? It just feels like the whole trait branch history is a waste in the FF merge.
Are there any disadvantages to using non-FF that I haven't considered?


When reading the "flat" log (for example git log --oneline

) of git, I think it's not a big deal involved with this merge. But when using the quirky one, git log --format ...

it can be absolutely useful when the log looks like this. At least in my opinion.

*   e3f667e (HEAD, origin/master, master) Merge branch 'issue#1702'
|\
| * ec359fe (origin/issue#1702, issue#1702) 1702: two
| * 45a63b3 1702: two
* |   97bbec7 Merge branch 'issue#1701'
|\ \
| |/
|/|
| * f959cc9 (origin/issue#1701, issue#1701) 1701: two
| * 9217d3c 1701: one
|/
*   6c934ea Merge branch 'issue#1606'
|\
| * 365eac5 (origin/issue#1606, issue#1606) 1606: two
| * 95df1c9 1606: two
| * ad79b01 1606: one
|/
*   02dbcea Merge pull request #1 from babbelnedd/issue#1605
|\
| * d24d200 (origin/issue#1605, issue#1605) 1605: two
| * 7ef0a8e 1605: two
| * 5aac64d 1605: one
|/
* 585d8b9 Initial commit

      

+3


source to share


2 answers


You are absolutely correct that there is no point in using feature branches while merging FF.

The "Gitflow way" is to not use FF when merging in topic branches:



The --no-ff flag forces the merge to always create a new commit object, even if the merge can be fast-forward. This avoids losing information about the historical existence of the trait branch and grouping together all the commits that together added the feature.

( Source )

+1


source


Looks like Gitflow headliners designed to take advantage of accelerated merge.

Quote from Jeff Kreeftmeijer 's blog about the Git-Flow tool . Pay attention to the "fast-forward" message.



As the output already explains, you are now in a new branch that you can use to work with your function. Use git as usual and terminate the function using the completion function:

$ git flow feature finish authentication
Switched to branch 'develop'
Updating 9060376..00bafe4
Fast-forward
 authentication.txt | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 authentication.txt
Deleted branch feature/authentication (was 00bafe4).

Summary of actions:
- The feature branch 'feature/authentication' was merged into 'develop'
- Feature branch 'feature/authentication' has been removed
- You are now on branch 'develop'

      

0


source







All Articles