Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo ""
- echo "-- Create the "library" repository."
- echo ""
- mkdir repoLib
- cd repoLib
- git init
- echo test > test.txt
- git add .
- git commit -m "Adding test.txt"
- cd ..
- echo ""
- echo "-- Create a bare repository that we can push into (emulating what we're doing in gitolite)."
- echo ""
- mkdir repoMain_Server
- cd repoMain_Server
- git init --bare
- cd ..
- echo ""
- echo "-- Close the server repository."
- echo ""
- git clone repoMain_Server repoMain
- cd repoMain
- echo ""
- echo "-- Write a file and push to the server repo."
- echo ""
- echo test > test2.txt
- git add .
- git commit -m "Adding test2.txt"
- git push origin master
- echo ""
- echo "-- subtree add the library repository and push the results to the server. If --squash is removed everything will work."
- echo ""
- git subtree add -P Subtree/librepoLib --squash ../repoLib master
- git push
- cd ..
- echo ""
- echo "-- clone the main repo and attempt to split out Subtree/librepoLib, should succeed"
- echo ""
- git clone repoMain repoMainClone
- cd repoMainClone
- git subtree split -P Subtree/librepoLib -b libABranch
- cd ..
- echo ""
- echo "-- pull the main repo and attempt to split out Subtree/librepoLib, should error (fatal: bad object ...)"
- echo ""
- mkdir repoMainPull
- cd repoMainPull
- git init
- git pull ../repoMain
- git subtree split -P Subtree/librepoLib -b libABranch
- cd ..
- echo ""
- echo "-- clone the server repository as if we were a separate user on a separate computer."
- echo ""
- git clone repoMain_Server repo_working
- cd repo_working
- echo ""
- echo "-- attempt to split out Subtree/librepoLib, should error (fatal: bad object ...)"
- echo ""
- git subtree split -P Subtree/librepoLib -b libABranch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement