Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>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.



I 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.


you could do git checkout -b backup-of-branch-foo and push that, before force pushing branch-foo, for the paranoid




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: