git引用說明

理解

git用文件保存patch的哈希值,這個文件名代表一個分支。指針、分支、引用理解是表示一個概念。

git本地倉庫

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)

參考

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章