![]() ![]() ![]() Since it is not a symbolic ref, it must point directly to the commit itself. git symbolic-ref HEAD fails with fatal: ref HEAD is not a symbolic ref.You can think of a detached HEAD as being on an unnamed branch. When HEAD is detached, it points directly to a commit-instead of indirectly pointing to one through a branch. (Symbolic refs were originally implemented as symbolic links, but later changed to plain files with extra interpretation so that they could be used on platforms that do not have symlinks.) It points to an object through some other reference. This is what it means to be a “symbolic ref”. That commit is the current tip or “head” of the master branch. The branch named “master” is checked out. git symbolic-ref HEAD yields refs/heads/master.HEAD follows automatically since it just points to the branch. When you make a new commit, the branch that HEAD points to is updated to point to the new commit. When HEAD is not detached (the “normal” 1 situation: you have a branch checked out), HEAD actually points to a branch’s “ref” and the branch points to the commit. HEAD is the symbolic name for the currently checked out commit. First, let’s clarify what HEAD is and what it means when it is detached. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |