Skip to content

Instantly share code, notes, and snippets.

@chalstrick
Last active December 1, 2017 16:03
Show Gist options
  • Save chalstrick/c743b10b1ccd7a6954f12260ea0c59b9 to your computer and use it in GitHub Desktop.
Save chalstrick/c743b10b1ccd7a6954f12260ea0c59b9 to your computer and use it in GitHub Desktop.
git init subRepo
cd subRepo/
touch a
git add a
git commit -m addA
cd ..
git init rootRepo
cd rootRepo/
touch b
git add b
git commit -m addB
git branch side
git submodule add ../subRepo/ sub
git commit -m addSub
git tag withSub
git reset --soft side
rm -fr sub
git checkout withSub
ls
## See how native git doesn't touch the filesystem because index==MERGE. If index==MERGE git thinks there is nothing to do.
## But JGit thinks the index has to be updated and therefore also populates the working tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment