3 ms·
>Where I still get nervous is when I force push my branch after a rebase, even if I know I am the only one working on it. It sounds like you recognise that thi
by milesrout 2y ago
>Where I still get nervous is when I force push my branch after a rebase, even if I know I am the only one working on it.
It sounds like you recognise that this is an irrational fear but in case you don't: this is an irrational fear.
- rectang 2y agoI agree that it won't cause collaboration issues. Perhaps the fear arises because force pushing destroys your backup, so to speak? I freed myself from the fear of losing data after a rebase when I learned to restore from a commit in `git reflog`. So long as your work made it into an actual commit at some point, everything is recoverable from the local repo's history[1]. [1] Ignoring giganto repos that actually trigger garbage collection.
- fragmede 2y agoyou could do git checkout -b backup-of-branch-foo and push that, before force pushing branch-foo, for the paranoid