forked from cederlys/git-as-a-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
21 lines (17 loc) · 776 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Git is basically a blockchain. The only thing that is missing is the
proof-of-work bit. We can easily add that to git using a pre-receive
hook. This repository contains a sample pre-receive hook.
Unless you are really lucky, you might want to run something like this
instead of "git push":
until git push origin main
do
sleep 1
git commit --amend --reset-author --no-edit
done
However, if you attempt to push multiple commits at once, you need
something more elaborate. And if you have more than 8 commits in the
repository (after your push), and don't want to wait a very long time,
you also need something more elaborate. This is left as an exercise
for the reader.
See githooks(1) for information on how to install this as a
pre-receive hook.