Clone a repository truncating the history to a certain depth. With a depth of 1, we copy only the latest revision of every file in the repo.
git clone --depth 1 repository://url
git clone --depth 1 https://gitlab.com/hkzlab-retrocomputing/AKAB_Reloaded.gitThe post-receive is a simple script. We can simulate the invocation after a push by simply feeding it the correct input in stdin.
echo "$FROM_ID $TO_ID master" | ./hooks/post-receiveTo recover the IDs required to replace the two variables in the script above, we can use git log and request the last two commits this way
# git log -2 --format=oneline --reverse
be030379bc039a6138d714790285b776dad21e31 Additional entries
70f86bde545d8f243aed32491ef3690b6c4ea19b Changed textThe two IDs are correctly ordered and can be fed to the script:
echo "be030379bc039a6138d714790285b776dad21e31 70f86bde545d8f243aed32491ef3690b6c4ea19b master" | ./hooks/post-receiveTo clone a repository in bare form
git clone --bare proto://address.of/your/repository.gitTo push a repository to a bare mirror
git push --mirror proto://address.of/mirror/repository.gitgit pull --allow-unrelated-historiesBack to Menu