GitHub's UI is fairly unintuitive and poorly thought-out, so here's a problem and a question:
What is the "head" repo? What is the "base" repo? I do not know which one is being copied from. The words "base" and "head" mean the same thing. The "head" of a linked list is similar to the "base" of a tree. (GitHub has fork tree and file tree.) "Head" and "base" are synonyms and mean the "start" of a data structure, so these labels are ambiguous.
Despite the arrow in the diagram, it is not apparent which repo is being copied from and which is copied to. They really should have included a "To" and "From" label to clear this up. The word "compare" does not imply directionality. This is really REALLY stupid wording. The arrow could mean "X into Y", or it could mean "Y into X".
Base: Base is the repository that will be updated. Changes will be added to this repository via the pull request. Following the example above, the base repo is your colleague's repo. Head: Head is the repository containing the changes that will be added to the base.
Base Branch: The "Base Branch" is the branch where your new changes should be applied / integrated into. Head Branch: The "Head Branch" is the branch that contains the changes you want to integrate.
The term HEAD refers to the current commit you are viewing. By default, you'll view the tip of the master branch on a repository, unless the main branch of your repository has a different name. The tip of the master branch is the most recent commit on the main branch of your codebase.
The default branch is also the initial branch that Git checks out locally when someone clones the repository. Unless you specify a different branch, the default branch in a repository is the base branch for new pull requests and code commits. By default, GitHub names the default branch main in any new repository.
The terms "head" and "base" are used as they normally are in Git. The head is the branch which you are on; that is, the branch with your changes. The base is the branch off which these changes are based. This is similar to the terminology used for git rebase
and git merge-base
.
For example, if I'm comparing changes I've made on my foo123
branch against the main Git repository, the base branch is the master
branch of git/git
, and the head branch is the foo123
branch of bk2204/git
. I would be proposing merging my changes on my foo123
branch into the main Git master
branch if I opened a pull request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With