2020-09-03 19:22:46 +02:00
|
|
|
At its core, Git is very simple. It stores "objects", which are basically files identified by an "identifier" (short: ID).
|
|
|
|
|
|
|
|
There are four types of objects: blobs, trees, commits, and tags. The simplest type is a "blob", which is just a piece of text.
|
|
|
|
|
|
|
|
Let's create some blobs! To do that, create a file with the desired content, and then use
|
|
|
|
|
|
|
|
$ git hash-object -w <file>
|
|
|
|
|
|
|
|
The flag -w means "write", and tells Git to actually write the new blob to the disk.
|
|
|
|
|
|
|
|
Create three new blobs!
|
2020-09-15 22:35:14 +02:00
|
|
|
|
|
|
|
Tip: you can also use a command like this to create a blob in a single line:
|
|
|
|
|
|
|
|
$ echo "awesome content" | git hash-object -w --stdin
|