-
Notifications
You must be signed in to change notification settings - Fork 2
Git Internals
Thomas Klepzig edited this page Nov 27, 2016
·
7 revisions
Der Hash repräsentiert nur den Inhalt der Datei
git hash-object -w test.txt
git cat-file -p *complete hash*
Dabei kann Typ Blob, Commit, Tree oder Tag sein
git cat-file -t *complete hash*
Blob Objekt, das per kompletten SHA-1 Hash angegeben wird, in die Staging Area schieben und anschließend ein Tree-Objekt erzeugen
Dabei werden zusätzlich zum Dateiinhalt auch noch Zugriffsberechtigung und Dateiname gespeichert
git update-index --add --cacheinfo 100644 *complete blob-hash* test.txt
git write-tree
echo 'first commit' | git commit-tree *tree-hash*
git update-ref refs/heads/master *complete commit-hash*
git symbolic-ref HEAD refs/heads/master
Siehe https://git-scm.com/book/en/v2/Git-Internals-Git-Objects