I had a talk with teammate about git. I tried to convince him that he should use amend, rebase -i and use meaningful commit messages. He just asked "why" and well... That's a good question. I tried to use argument like clean history, easier to read and find bugs, and well it looks nice. He just said that who the hell reads git commits or check out tree, everybody just commit — push and when time comes merge it. Why bother?
To be honest I had no idea what to say. The worst part is that rest of the team thinks similar. Can somebody please help me, how can I convince them to do a little more work just to keep git clean?
The worst part is I am new in the team and a lot younger than others, so I can't just use more experienced developer card.
EDIT
Since there is a misunderstanding about what I meant by rebase: I try to convince team to use rebase -i when you are working on local changes, on local branch which is not pushed. Just to clean up if you didn't amend in time.
The question boils down to whether you need a history in your VCS repositories or not. You do need it in cases when:
So if the history is easy to inspect, these goals are easily achievable.
Nowadays Git is not used in a vacuum, and I think your team is right.
There is often a bug tracker, a code review tool (that uses pull requests) and a CI system that build the code and runs the tests in cloud. These are integrated together and systems are in place to ensure that no broken code is merged to the main branch and everything is properly reviewed and approved before the merge.
And primarily these tools are used to keep track of the work and not the Git history.
If there is a bug, then VSCode's Git Lens extension shows immediately who changed the problematic line the last time. So we can ask him. But even if we are not sure we can always go to the team chat and mention "hey why did we wrote this that way?". We don't assign blame.
In the last 5 years since we moved to Git from Perforce I never had to look back or bisect the git history ever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With