Git Force Push Practices
The cluster focuses on debates about using git push --force, its risks like overwriting remote history, safer alternatives such as --force-with-lease, and best practices like disabling it on shared branches or main repos.
Activity Over Time
Top Contributors
Keywords
Sample Comments
How about 'git push --consensual'?
If no one has pulled your branch, just do a force push (use --dry-run to double-check your push).
Still need to be able to "push --force" on the remote repo for this to be useful, right?
I really hope force push is disabled on the repo :)
Can you still push to the repo? Perhaps via --force?
No, that’s not right. If you did that, you would need to force push to get the result pushed to the remote.
There's git push --force-with-lease, which is a safer alternative.
Surprised that people allow force-push on git. If it needs to be done, it should only be done after consultation and disabled after.
He must be using push --force in that case.. which seems like a bad practise.
Why do you force push to their branch, instead of committing your fixes as separate commits later on?