News for hackers. Stuff that matters.
Re:Extremely Linear Git History by couchand on Tuesday November 22, 2022 @01:51PM (#33709467)
recursion
Re:Extremely Linear Git History by simiones on Wednesday November 23, 2022 @04:57AM (#33717177)
What does that mean in the context of git?
Re:Extremely Linear Git History by couchand on Wednesday November 23, 2022 @09:55AM (#33719847)
There is nothing special about the main branch! This is the recipe to collaborate in git:

- Pick a shared branch to work on.

- Work.

- If you complete within a day, push to shared branch.

- If you need to hold onto it longer, make a new branch, switch to it.

- (Possibly recurse.)

- Complete work, rebase new branch on shared branch, push.

And of course feel free to replace branch with remote/branch. It is distributed, after all, nothing special about any particular server.

A worked example, to make it more concrete:

- Pick the shared branch main.

- Work on a feature for more than a day, so:

- Create a feature branch feature/e2ee, switch to it.

- Recurse, since you'll be doing database updates and I'm adding the UI.

- Pick the shared branch feature/e2ee.

- I create a branch git.sr.ht/~couch/new-twitter/feature/e2ee

- You work and push to feature/e2ee.

- I complete my work, rebase the branch, and push to feature/e2ee.

- We are satisfied that we've completed the feature, rebase and push to main.

Re:Extremely Linear Git History by simiones on Wednesday November 23, 2022 @11:02AM (#33720884)
That doesn't really solve much: if both you and I rebase our personal feature branches onto master at different places, when we both try to push to the shared feature branch, we'll have a REALLY bad time - especially if we actually had to do conflict resolution.