I am using EGit plugin for Eclipse but whenever I add my project to Git, the plugin puts a "NO-HEAD" indication next to my project folder in Eclipse directory view. Am I doing something wrong ? What does this mean ?
The HEAD points out the last commit in the current checkout branch. It is like a pointer to any reference. The HEAD can be understood as the "current branch." When you switch branches with 'checkout,' the HEAD is transferred to the new branch.
In Git, a head is a ref that points to the tip (latest commit) of a branch. 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.
Your Eclipse has a version control plugin installed (probably Subclipse, a client plugin for subversion, or perhaps another one). "NO HEAD" I believe means that Eclipse/Subclipse can no longer find the latest copy of your project since you moved it outside of there.
In Git, HEAD refers to the currently checked-out branch's latest commit. However, in a detached HEAD state, the HEAD does not point to any branch, but a specific commit or the remote repository.
It can simply mean that, until you make your first add and first commit, you have no branch (not even a master
one), hence no HEAD
referencing any branch.
See more in "Why do I need to explicitly push a new branch?".
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