Is it possible to ask Mercurial to show only the heads of one branch? For example, I often want to double-check that default
only has one head, but currently I need to do that "manually" (ie, checking the output of hg heads
for more than one entry which is in default
).
Remember that the HEAD is Git's way of referring to the current snapshot. Internally, the git checkout command simply updates the HEAD to point to either the specified branch or commit. When it points to a branch, Git doesn't complain, but when you check out a commit, it switches into a “detached HEAD” state.
You can view your repository's heads in the path . git/refs/heads/ . In this path you will find one file for each branch, and the content in each file will be the commit ID of the tip (most recent commit) of that branch.
Answer. There can be any number of heads in a repository. By default there is one head known as HEAD in each repository in GIT.
The HEAD in Git is the pointer to the current branch reference, which is in turn a pointer to the last commit you made or the last commit that was checked out into your working directory. That also means it will be the parent of the next commit you do.
hg heads <branch name>
works on Mercurial 1.5.3.
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