Skip to content

Instantly share code, notes, and snippets.

@chalstrick
Created February 13, 2017 17:05
Show Gist options
  • Save chalstrick/942a1ebc0be01d4e350cdc9c1ba9e45c to your computer and use it in GitHub Desktop.
Save chalstrick/942a1ebc0be01d4e350cdc9c1ba9e45c to your computer and use it in GitHub Desktop.
rm -fr writingClient*/ readingClient*/ server/
mkdir server
git init --bare server/repo.git
git daemon --base-path=server --export-all --enable=receive-pack &
git clone git://127.0.0.1/repo.git writingClient
cd writingClient
touch a
git add a
git commit -m add_a
git push origin HEAD:master
cd ..
git clone git://127.0.0.1/repo.git readingClientNative
git clone git://127.0.0.1/repo.git readingClientJGit
cd writingClient
touch b
git add b
git commit -m add_b
COMMITID=$(git rev-parse HEAD)
echo 2 >b
git commit -a -m mod_b
git push origin HEAD:master
cd ../readingClientNative
git fetch origin $COMMITID:new
git -C ../server/repo.git config uploadpack.allowreachablesha1inwant true
git fetch origin $COMMITID:new
cd ../readingClientJGit
jgit fetch origin $COMMITID:new
git config uploadpack.allowreachablesha1inwant true
jgit fetch origin $COMMITID:new
cd ..
kill %1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment