Create objects
, refs/heads
, refs/tags
folders, and HEAD
file. Show that it's not a git repo (git status
)
echo "git is awesome" | git hash-object --stdin
git hash-object <filename>,
- add
-w
, show contents of.git/objects
folder. Explain directories naming - write an identical file and show that the hash is the same
- write a different file, show that the hash is different, and show another blob in the repository
- working directory
- index/cache/staging area
- repository
- create a subfolder, and add file to the subfolder
git update-index --add --cacheinfo 100644 <blob-hash> <filename>
and variations:- existing file (previously written to a repo with
git has-object -w
) - non-existing file,
- existing file but with content different that in the blob
- existing file (previously written to a repo with
- create an untracked file (don't add it to the index)
git write-tree
git cat-file
for the created tree
- create commit:
git commit-tree <tree-hash> -m <commit message>
git cat-file
for commit- create a commit with a parent commit
- Explain that git history is a snapshot of the state of the tree, not a sequence of diffs
- create 2 branches by creating 2 files in
.git/refs/heads
folder. Point branches to specific commits - change the reference in the
HEAD
file to another branch. Show the result withgit branch
- Summary: branches and
HEAD
are just references (as well as tags)
- http://git-school.github.io/visualizing-git/
16. Demonstrate
merge
vsrebase
- https://learngitbranching.js.org
https://github.com/pluralsight/git-internals-pdf
https://blog.thoughtram.io/git/2014/11/18/the-anatomy-of-a-git-commit.html
https://jwiegley.github.io/git-from-the-bottom-up/1-Repository/5-the-beauty-of-commits.html
https://www.freecodecamp.org/news/git-internals-objects-branches-create-repo/
https://aboullaite.me/deep-dive-into-git/
https://gitolite.com/uses-of-index.html
https://www.chromium.org/developers/fast-intro-to-git-internals
https://www.tutorialspoint.com/what-is-3-way-merge-or-merge-commit-in-git