DEV Community

loading...

Discussion on: Avoiding the messy git history

Collapse
vlaja profile image
Vlatko Vlahek Author

I would say this depends whether you are working solo on a feature or with another developer, based on the feature complexity.

In the case of multiple people working on a branch --force-with-lease is a safer option, although from my perspective the risk is very small. I have personally never got a "racing condition" in overwriting the branch with --force only.

Even if this happens, it is still possible that the person whose commits got overwritten does git reflog locally and rebases again on the current state of the remote branch persisting both changes.