Skip to content

Instantly share code, notes, and snippets.

@AndrewSmart
Created June 13, 2014 18:00
Show Gist options
  • Save AndrewSmart/1796bc4fffc4e46e8150 to your computer and use it in GitHub Desktop.
Save AndrewSmart/1796bc4fffc4e46e8150 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
mkdir lib p1 p2 && git init --bare lib && git init p1 && git init p2
git clone lib lib.git && cd lib.git && touch readme && git add readme && git commit -m "Initial lib" && git push && cd ..
cd p1 && touch p1 && git add p1 && git commit -m "Initial" && git subrepo clone ../lib lib -b master && cd ..
cd p2 && touch p2 && git add p2 && git commit -m "Initial" && git subrepo clone ../lib lib -b master && cd ../p1
echo "p1 initial add to subrepo" >> lib/readme && git add lib/readme && git commit -m "p1 initial add to subrepo" && git subrepo push --all
cd ../p2 && git subrepo pull --all
echo "p2 initial add to subrepo" >> lib/readme && git add lib/readme && git commit -m "p2 initial add to subrepo" && git subrepo push --all
cd ../p1 && git subrepo pull --all -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment