DEV Community

Discussion on: A journey of self-discovery... and also how I learned how to use Git

grmnsort profile image
Germán Rodríguez Ortiz

Hi Nicolas,

You're totally right, when you read the post, it seems that I put the responsibility entirely on the FF strategy that our log was hard to read, when I wanted to explain that our poor handling of the repository, led to a really messy git history when using the FF strategy. By that time we had no commit standards, so a feature or bugfix would be made of any number of commits, mixing "WIP" commits with actual "this is what I want to add to the master branch" commits. The FF merge would either result in the conflict resolution or the mixing of those unwanted commits in our history and since some of our wasn't properly updated would scatter the mentioned work across the whole log :( making it really hard to keep track or "undo" the merged work if necessary.

Just like you said I also believe it's really important to have a commit standard agreed across the team, we're using now the conventional commits syntax and it has really helped to improve our git history.

We actually ended up learning about the FF strategy, and I realized I should've talked a little more about that in the From there we started addressing each problem detected one at a time: section.

We ended up choosing the "non-fast-forward strategy" because, during our test runs, we agreed that the merge commit strategy made more clear to us what and when some feature/bugfix entered the master branch, it also made easier reverting features or bugfixes that were merged to the test branch with the use of tools such as GitKraken. And in the case that some dev forgot to keep any branch up to date, we could quickly notice and act upon.

I'll be trying to add these clarifications to the text ASAP :)

primercuervo profile image
Nicolas Cuervo

Hey German,

thanks a lot for taking your time and provide such detailed answer. I understand that there is a bunch of ways of doing things, and it is incredibly hard to have consensus over how to adapt the team workflow to the tools available.

I have had years of experience using Git with a rather large number of teams, and even though I purposely try to spend a long time at the beginning of a project defining the way we are going to collaborate (which others, normally a majority, think is too long), I notice that the time invested doing that really pays off over time, not only because we end up speaking the same language over the collaborative tools, but also because it hugely saves developing/testing/shipping time.

One day I heard (or read) something and I have never forgotten it, and even use the following quote in the Git workshops that I've held for teams new to the tool: "the Git history is part of the code, and it has to be treated as such". For example: just as you would reject a pull request with buggy code, a pull request with an amazing piece of documented and tested code might (and should IMHO) be rejected if it has superfluous commits or dubious commit messages, as this is something that the developers can fix themselves. This, among other things, might or might not be enforced by each team lead, depending on the maturity of the project.

Thanks a lot for sharing your experience!