Skip to content

Instantly share code, notes, and snippets.

@darrinholst
Last active Jul 15, 2016
Embed
What would you like to do?
#!/usr/bin/env bash
echo -e "\n\n***\n*** Cleaning up\n***\n\n"
rm -rf ws1 ws2 remote
mkdir ws1 ws2 remote
echo -e "\n\n***\n*** initialize the remote repo\n***\n\n"
cd remote
git init --bare
cd ..
echo -e "\n\n***\n*** initialize workspace 1\n***\n\n"
cd ws1
git init
gtm init
echo "#GTM test" > README.md
git add .
git commit -m "initial commit"
git remote add origin $(cd ../remote && pwd)
git push origin master -u
cd ..
echo -e "\n\n***\n*** initialize workspace 2\n***\n\n"
cd ws2
git clone ../remote .
gtm init
cd ..
echo -e "\n\n***\n*** do some work in workspace 1, but don't push gtm\n***\n\n"
cd ws1
vim README.md
git commit -am "from workspace 1"
git push
cd ..
echo -e "\n\n***\n*** do some work in workspace 2 and push gtm\n***\n\n"
cd ws2
git pull
vim README.md
git commit -am "from workspace 2"
git push
git pushgtm
cd ..
echo -e "\n\n***\n*** back to workspace 1 to try and fetch gtm\n***\n\n"
cd ws1
git pull
git fetchgtm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment