Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: HEAD vs head [duplicate]

Tags:

git

All the documentation I can find refers to HEAD and I've heard numerous times that it's case sensitive.Yet I'm able to do things like,

git log head...merge_head

and it works just like

git log HEAD...MERGE_HEAD

Is this due to some customization in my local setup that I'm unaware of, or is it just an undocumented feature (maybe to discourage such practice)?

like image 435
ivan Avatar asked Jul 03 '15 20:07

ivan


People also ask

What is the difference between head and head in git?

The difference between HEAD^ (Caret) and HEAD~ (Tilde) is how they traverse history backwards from a specified starting point, in this particular case HEAD .

What is difference between head and head?

- In other words; the head tag is used for document title, styling, scripts, etc. Whereas the header tag is used for headers as seen in articles.

What is a head in git?

When working with Git, only one branch can be checked out at a time - and this is what's called the "HEAD" branch. Often, this is also referred to as the "active" or "current" branch. Git makes note of this current branch in a file located inside the Git repository, in . git/HEAD .

Is head same as master in git?

The simple answer is that HEAD is a pointer/label to the most recent commit of the branch you are currently on. master is the default branch created when you initialized a git repository (e.g. git init ). You can delete the master branch (e.g. git branch -D master ). You cannot delete the HEAD pointer.


1 Answers

Case sensitivity depends on your system, HEAD is case-sensitive on Linux, insensitive on Windows (e.g. msysgit) an can be both on OSX depending of the file-system configuration (HFS+ is case-insensitive by default but when formatting you can also set it to case-sensitive). For instance, on Linux I get:

git log head
fatal: ambiguous argument 'head': unknown revision or path not in the working tree.

While git log HEAD works fine.

like image 56
mziccard Avatar answered Oct 05 '22 20:10

mziccard