DEV Community

Discussion on: How to Fix a Typo After You've Already Pushed Your Commit

Collapse
 
kiliman profile image
Kiliman

I would clarify that as never rebase after you push to a remote shared with others. I push and rebase my feature branch all the time. It's especially helpful when reviewing pull requests.

Collapse
 
bellawoo profile image
Bella Woo • Edited

A feature branch pushed up to a shared repository is available to others, so at this point, it becomes a matter of communication and etiquette. I wouldn't force push to a remote branch if someone else is actively committing or has an upstream based off of mine, but that situation is rare on the teams I work on.

Thread Thread
 
kiliman profile image
Kiliman

If we end up with a feature branch that other developers would work on (pretty rare), we would just treat it like we do for master. Create a new branch off it, rebase and merge. Same workflow.

Thread Thread
 
jdforsythe profile image
Jeremy Forsythe • Edited

While it may be rare, I prefer a workflow that doesn't have any gotchas. If we never rebase anything that has been pushed, our workflow never requires the developer to wonder if anyone else might be affected by a rebase. My devs have enough to think about. The more I can take off their plate, the better.

Thread Thread
 
kiliman profile image
Kiliman

That's the nice thing about git. It supports different workflows. So whatever works best for your team is what you should do. There is no right or wrong way.