Just for clarification:
When you have already pushed your feature branch to remote, and you rebase to develop then the next push to remote would need force or force-with-lease ??
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Just for clarification:
When you have already pushed your feature branch to remote, and you rebase to develop then the next push to remote would need force or force-with-lease ??
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.