Skip to content

Git As DB

Kenneth Kasajian edited this page May 17, 2018 · 1 revision

use git to store and retreive stuff

echo 12345| git hash-object -w --stdin

will store "12345" in its object store and return it hash.

assuming the hash is d1877a49e284a4b7cbcc7bcc9d8ab3d1f0235411, you can retreive the value using:

git cat-file -p d1877a49e284a4b7cbcc7bcc9d8ab3d1f0235411

Clone this wiki locally