git对象

nanayin@201605050385- MINGW64 /f/gitdemo (master)
$ git log -l --pretty=raw
commit 492478d7ebc1e6bc7104e585c6fe2b38185521c3
Author: yinnana 
Date:   Wed Jan 4 13:53:11 2017 +0800

    test

commit 268afa36b9b348228fd2fc77b12423d9e97d710b
Author: yinnana 
Date:   Wed Jan 4 13:13:50 2017 +0800

    test

commit df69eb991294825b467ca423d38aedd4117ca0f1
Author: yinnana 
Date:   Wed Jan 4 12:35:39 2017 +0800

    initialized
nanayin@201605050385- MINGW64 /f/gitdemo (master)
$ git cat-file -t  492478d7e
commit
nanayin@201605050385- MINGW64 /f/gitdemo (master)
$ git cat-file -p 492478d7e
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
parent 268afa36b9b348228fd2fc77b12423d9e97d710b
author yinnana  1483509191 +0800
committer yinnana  1483509191 +0800

test

nanayin@201605050385- MINGW64 /f/gitdemo (master)
$ for id in 492478d7e 268afa36b9 df69eb991;do \
> ls .git/objects/${id:0:2}/${id:2}*;done                                       .git/objects/49/2478d7ebc1e6bc7104e585c6fe2b38185521c3
.git/objects/26/8afa36b9b348228fd2fc77b12423d9e97d710b
.git/objects/df/69eb991294825b467ca423d38aedd4117ca0f1

master分支的实现:

$ git log -l HEAD
$ git log -l master
$ git log -l refs/heads/master
$ git rev-parse master
df33bea3141db42c47dfb8fc2ce1d1d9416100e2

$ git rev-parse refs/heads/master
df33bea3141db42c47dfb8fc2ce1d1d9416100e2

$ git rev-parse head
df33bea3141db42c47dfb8fc2ce1d1d9416100e2
$ find .git -name HEAD -o -name master
.git/HEAD
.git/logs/HEAD
.git/logs/refs/heads/master
.git/refs/heads/master
git对象_第1张图片


你可能感兴趣的:(Git)