理解
git用文件保存patch的哈希值,這個文件名代表一個分支。指針、分支、引用理解是表示一個概念。
1、在.git
目錄下查看
HEAD #指向當前分支
refs/heads/ #分支,記錄本地commit對象
refs/tags/ #tag也記錄commit對象,但是通常不會改變
refs/remotes/origin/ #服務器映射下來的遠程只讀分支
2、查看HEAD內容
mi@ubuntu:test3$ cd .git
mi@ubuntu:.git$ cat HEAD
ref: refs/heads/master
mi@ubuntu:.git$ cat refs/heads/master
ca82a6dff817ec66f44342007202690a93763949
mi@ubuntu:.git$ git show HEAD
commit ca82a6dff817ec66f44342007202690a93763949 (HEAD -> master, origin/master)