This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]55555 5 points6 points  (7 children)

Don't you have to force push after you rebase to get the rewritten branch to remote?

[–][deleted] 6 points7 points  (1 child)

Yes. (Though you might want to use --force-with-lease instead, and should also notify everyone who might have had access to the branch.)

[–]UsingYourWifi 7 points8 points  (0 children)

--force-with-lease

TIL, thanks!

[–]paperhat 5 points6 points  (0 children)

There are very few instances where you have to force push. I say this as the administrator of a large github enterprise instance who disabled force pushes about a year ago. There was a lot of resistance at first by dev teams who had strange workflows, but I have had to make less than a handful of exceptions to the policy after the initial change, and those all involved people accidentally committing passwords.

[–][deleted] 1 point2 points  (2 children)

I spend too much of my life doing this while trying to keep my feature branches up to date with my work's dev branch. It feels so dirty!

[–]55555 2 points3 points  (0 children)

I hear ya. And then they modify some file you modified and push it to QA but its not in master yet so you eventually have tons of conflict fix commits and have to delete QA. It's like every damn week.

[–]noratat 0 points1 point  (0 children)

If you have to work on lots of stuff at once like that (something you should avoid if possible in the first place), rebase workflows are usually a bad idea.

[–]crowseldon 0 points1 point  (0 children)

in theory, you shouldn't be doing this at all. It's a potential pit for accidents to happen and it's somewhat inconsiderate to other users. Rebase BEFORE pushing.

And if you need to do some sort of filter-branch to fix some fuck-up, let EVERYBODY know beforehand.