4 ms·
> If you screw up a rebase, the history is re-written… https://git-scm.com/docs/git-reflog https://git-scm.com/docs/git-reflog > …or force-pushed by accident
by elmigranto 10y ago
> If you screw up a rebase, the history is re-written…
https://git-scm.com/docs/git-reflog https://git-scm.com/docs/git-reflog
> …or force-pushed by accident
Well, you could nuke git folder "by accident" as well :) Jokes aside, don't force-push to "other's" branches).
- falsedan 10y agoIf you really feel like you do have to force-push to someone else's branch, please use git push --force-with-lease origin/other_branch so you at least won't trash any commits your collaborator pushed after you last fetched their branch. git will see that your origin/other_branch doesn't match origin's other_branch, and will bail out so you can pull the changes and decide how to incorporate them.