Hacker News new | past | comments | ask | show | jobs | submit login

I'm struggling to follow why a merge base makes a difference? Or even exactly what one is?

A couple of questions which might help clear things up:

Do you consider `main` a branch?

If you create a new branch called `feature1`, do you consider the commits from before the branch from `main` to be "part of" that branch or not?

What if you delete `main`? Are the commits from before the branch part of the `feature1` branch then? What if there are multiple surviving feature branches that share varying amounts of common history?




main is a branch. By convention, it contains all of the commits back to an ancestor that has no parents.

Unless given more information, I would consider the commits between `git merge-base main feature1` (exclusive) and feature1 (inclusive) as part of the feature1 branch.

Now, if I `git checkout -b feature1-A feature1`, what commits are part of branch feature1-A? It depends. With respect to which merge base?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: