Hacker News new | past | comments | ask | show | jobs | submit login

Nice overview. There is a lot of rebasing going on, and I wonder how that would work when more than one person works on the downstream fork. Force-pushing can easily break other users’ checkouts.





People in OSS often talk about “maintaining patches” on top of an upstream. That’s rebase in another guise.

Rule of thumb is:

- never force push a branch

- at least not if someone else could be working on it

- and definitely not without talking to them about it

Personally I force push my branches quite often. It's super useful to rebase my branch on to main/master or doing an interactive rebase to reorder my commits, merge or just change the commit message.

I've been on the other end of someone rebasing and force pushing. I've found that just removing the branch from my local git and then checking it out fresh from origin is the simplest way to go.


You can also `git fetch` and `git reset --hard origin/force-pushed-branch` to get your local branch up to speed with remote one assuming you don't have any local changes.

And if you do have changes, can create a new (temp) branch from diverged, reset the diverged branch to origin and cherry pick your own commits on top.



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

Search: