-
-
Save jacyzon/9709215 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First commit | |
echo "hello" | git hash-object -w --stdin | |
git update-index --add --cacheinfo 100644 ce013625030ba8dba906f756967f9e9ca394464a hello.txt | |
git write-tree | |
git commit-tree aaa96c -m "First commit" | |
git update-ref refs/heads/master 30b060d9a7b5e93c158642b2b6f64b2b758da40d | |
# Second commit | |
echo "hola" | git hash-object -w --stdin | |
git update-index --add --cacheinfo 100644 5c1b14949828006ed75a3e8858957f86a2f7e2eb hola.txt | |
git write-tree | |
git commit-tree 27b9d5 -m "Second commit" -p 30b060 | |
git update-ref refs/heads/master 97b806c9e5561a08e0df1f1a60857baad3a1f02e | |
-- | |
1. Write blob object by content | |
2. Write staging area by file mode, blob object SHA1 and file name | |
3. Write tree object based on staging area | |
4. Write commit object by root tree object SHA1 and parent commit object SHA1 | |
5. Update master reference by commit object SHA1 | |
1~2 is "git add" | |
3~5 is "git commit" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment