Skip to content

Instantly share code, notes, and snippets.

@cg-soft
Last active May 19, 2016 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cg-soft/62ac3529cf9ad6f6586e07866de43bc4 to your computer and use it in GitHub Desktop.
Save cg-soft/62ac3529cf9ad6f6586e07866de43bc4 to your computer and use it in GitHub Desktop.
#!/bin/sh
rm -rf origin client
git init origin
( cd origin
echo 'A file' > file.txt
git add file.txt
git commit -m 'Initial commit' )
git clone origin client
cat > client/.git/config <<EOF
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = /Users/christian.goetze/git/tag-merge-demo/origin
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/private/tags/*:refs/tags/*
[branch "master"]
remote = origin
merge = refs/heads/master
rebase = true
EOF
( cd client
git tag PUBLIC_TAG
git push origin 'refs/tags/PUBLIC_TAG:refs/tags/PUBLIC_TAG'
git tag PRIVATE_TAG
git push origin 'refs/tags/PRIVATE_TAG:refs/private/tags/PRIVATE_TAG'
git remote show origin
git fetch --prune
git tag )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment