Rename chapters into "internals" and "intro"

This commit is contained in:
Sebastian Morr 2020-10-01 15:03:02 +02:00
parent 70fe577788
commit f3ff5c5147
97 changed files with 0 additions and 0 deletions
levels/internals/tree-read

View file

@ -0,0 +1,7 @@
As soon as you have some tree objects, you can always read them and set the index exactly to their content! Unsurprisingly, the command is called
git read-tree <tree>
For <tree>, you can provide the hash of any tree object - you can right-click one to insert its hash into the terminal!
Try reading some of the trees in this repository into the index!

View file

@ -0,0 +1 @@
git read-tree "$TRIPLE_TREE"

View file

@ -0,0 +1,15 @@
EMPTY_TREE=$(git write-tree)
echo "file 1" > file1
echo "file 2" > file2
git add .
git write-tree
rm *
echo "file A" > fileA
echo "file B" > fileB
echo "file C" > fileC
git add .
TRIPLE_TREE=$(git write-tree)
git read-tree "$EMPTY_TREE"

View file

@ -0,0 +1 @@
test "$(git ls-files | wc -l)" -gt 0