I’ve heard recently people banding around the term “GIT Fast Forward”. Truth be told, it has not been something that I have come across as of yet; so I thought I would investigate what it might be.
The first thing for me was to understand why it was “something”. A few of my work colleagues, working on a particular project, like to create feature branches and merge these into the master branch on completion. Nothing crazy about this, seems quite normal; however, when merging their branches into the master branch they would use the following flag –
What does this do? Well this flag, causes the merge to create a new commit object. This means it will retain information about the historical existence of the feature branch it came from and the commits that built up this branch.
This sounds quite normal to me. I got to thinking however, why is this not the default behavior of GIT?
It would depend on your development workflow. I tend to work in a way that means my branches are very short lived. This means when merging in fast forwarding is what I would expect it to do. Ideally you would only really want to use that flag if you were working on features for a large amount of time; something that you would iterate on for a while, possibly even merging several times into the master branch during the branches shelf life then not fast forwarding is what you are looking for.