git version control system -- some notes
Last updated at 7:07 pm UTC on 25 August 2017
Git From the Bits Up, Tim Berglund
https://www.youtube.com/watch?v=MYP56QJpDr4&feature=youtu.be
Explains the inner workings of git. A big object store (blobs).
Log of examples
Example 1
git init jax
cd jax
tree .git
git add beowulf.txt
git status
git commit -m "Initial commit"
git log
A setup of a git repository with
git init
is the regular way
Time: 5:46
remove example
cd ..
rm -rf jax
Example 2
A git repository is a collection of objects and a system of naming those objects.
The second example is a demonstration what is needed in the .git subdirectory.
mkdir jax
cd jax
mkdir .git
mkdir .git/objects
mkdir .git/refs
mkdir .git/heads
In 'refs' are names for objects.
'refs' is a generalized name space for particular types of refs need. Internally they are called 'heads' what people normally call 'branches'.
tree .git
git help hash-object
git-hash-object - Compute object ID and optionally creates a blob from a file
objects is a big key-value store
echo "So. The Spear-Danes...." | git hash-object --stdin -w
git cat-file -p b0d9c44
"So. The Spear-Danes...."
git cat-file -t b0d9c44
blob
git cat-file -s b0d9c44
18
Time: 16:09
To be continued ......