Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第6章 Git对象 #44

Open
GH1995 opened this issue Jan 13, 2020 · 1 comment
Open

第6章 Git对象 #44

GH1995 opened this issue Jan 13, 2020 · 1 comment
Labels

Comments

@GH1995
Copy link
Owner

GH1995 commented Jan 13, 2020

Git 对象库探秘

git log -1 --pretty=raw

一个提交中居然包含了三个SHA1哈希值表示的对象ID:

  • commit e695606fc5e31b2m038a48a3d363f4c2la3d86:这是本次提交的唯一标识。
  • tree f58da9a820c3fd9d84ab2ca2b467ac2650381:这是本次提交所对应的目录树
  • parent a0c64le92bl0d8bccaledlbft84ca80340fdefee6:这是本地提交的父提交(上次提交)

git cat-file查看ID类型

git cat-fle -t e695606

image

image

@GH1995 GH1995 added the git label Jan 13, 2020
@GH1995
Copy link
Owner Author

GH1995 commented Jan 13, 2020

HEADmasterrefs/heads/master具有相同的指向

.git/refs是保存引用的命名空间

git rev-parse显示引用对应的提交ID

git rev-parse master
git rev-parse refs/heads/master
git rev-parse HEAD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant