How to remove git subtree reference

ryanve picture ryanve · Feb 26, 2015 · Viewed 7.6k times · Source

I added a subtree via

git subtree add --prefix=path/to/example --squash [email protected]:johndoe/example.git master

and want to remove it. There's no git subtree rm command. I already deleted all files in path/to/example but path/to/example still appears when I list subtrees via

git log | grep git-subtree-dir | awk '{ print $2 }'

How can I remove the subtree reference from git such that it can no longer be pushed/pulled/etc.?

Answer

user3477312 picture user3477312 · Apr 12, 2015

Simply remove the remote, which is the subtree reference: git remote rm example