3 ms·
That's a good point. How do you synchronize history rewriting across the local and remote copies of the private branches? Do you have a formalized way to ensure
by jarrett 13y ago
That's a good point. How do you synchronize history rewriting across the local and remote copies of the private branches? Do you have a formalized way to ensure it doesn't get messed up?
- acchow 13y agoWhere I work, you prefix the name of your branch with your username, like "acchow/new-feature". This tells other people "do not touch this branch because its history will be changed by acchow". Alternatively, if you use github, you can set access controls on forks to read-only and send pull requests from your fork to the main repo.
- benesch 13y agoIf you enforce a convention that private branches start with the developers initials (nb-restructre-everything), and that developers can force-push only their own branches, you can rely on each developer to keep their remote up-to-date. You can even rewrite a branch shared between developers that hasn't been merged mainline: once it's done, have one of the developers create a duplicate branch in their own private namespace, and rebase and merge that. Accidents happen, though. If you want to be guaranteed safety, enforce that every developer have their own remote fork. They can rebase at-will on their own fork, and submit pull requests to the mainline repository. (If you're using GitHub, this is dead simple, since you can open pull requests across forks.) This method introduces a fair bit of hassle and overhead for a smallish team, though.
- icambron 13y agoWhat benesch said, basically: just force push your own branches. Have to be careful if you work from multiple computers, though.