Git Subtree Experiment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -ex | |
| rm -rf demo | |
| mkdir demo | |
| (cd demo && git init) | |
| (cd demo && touch .gitignore) | |
| (cd demo && git add .) | |
| (cd demo && git commit -m 'Initial commit') | |
| (cd demo && git remote add nodejs-api-starter https://github.com/kriasoft/nodejs-api-starter.git) | |
| (cd demo && git fetch nodejs-api-starter) | |
| (cd demo && git checkout -b nodejs-api-starter nodejs-api-starter/master) | |
| (cd demo && git reset --hard f85245b8c6eb87c2b576034a3dd3c066c06ac726) | |
| (cd demo && git checkout master) | |
| (cd demo && git read-tree --prefix=api/ -u nodejs-api-starter) | |
| (cd demo && git add .) | |
| (cd demo && git commit -m "Merge 'kriasoft/nodejs-api-starter' into 'api/'") | |
| (cd demo && touch api/foo.txt) | |
| (cd demo && git add .) | |
| (cd demo && git commit -m 'Add api/foo.txt') | |
| (cd demo && touch api/boo.txt) | |
| (cd demo && git checkout nodejs-api-starter) | |
| (cd demo && git pull nodejs-api-starter) | |
| (cd demo && git checkout master) | |
| (cd demo && git merge -s subtree --no-commit nodejs-api-starter) | |
| # fatal: refusing to merge unrelated histories |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment