3 ms·
Push after rebase is safe and easy if: You have protection on your remote trunk branches against force push. You have git configured to push only the branch y
by lotyrin 10y ago
Push after rebase is safe and easy if:
You have protection on your remote trunk branches against force push.
You have git configured to push only the branch you are on, to the same name on the remote.
git rebase; git push -f;
It is HARD, DANGEROUS and SHITTY under other configurations.
<3 Git.
- takeda 10y agoAs long as no one else is using your branch as well, then they'll hate you.
- tunesmith 10y agoYeah, basically as soon as you push, then there's no guarantee that someone else hasn't checked it out. That's how I see it anyway. It'd be nice if git let you push (for backup/protection) without letting other people see it or check it out yet.
- JimDabell 10y agoIt's a fairly common practice to prefix branches only intended for your own work with your initials and a slash, e.g. jd/my-work-in-progress. You can't guarantee that nobody else will work off it, but it's their own fault if they do.
- andrewaylett 10y agoWe treat branches for tickets (prefixed with the ticket ID) as owned by the owner of the ticket: feel free to check out, but if the owner changes it underneath you, tough.