To update the sub-tree explicitly and independently from upstream you'll need to re-add the remote as you've indicated. In the new cloned repo:
$ git remote add -f <subtree-repo> <subtree-repo-url>
$ git pull -s subtree <subtree-repo> <branch>
For the link you gave it would be along the lines of,
$ git clone /Users/tekkub/tmp/test my-test-clone
$ cd my-test-clone
$ git remote add -f cork git://github.com/TekNoLogic/Cork.git
$ git pull -s subtree cork master
You can also use git subtree pull
supported on the very latest version on git.
The dependency scenario is not clear from the question, but you can also simply pull the repo you've cloned to get all the subtree updates:
(repo1)
(repo2 [subtree: repo1]) -- clone --> (repo3)
repo1 $ git commit ...
repo2 $ git pull -s subtree ...
repo3 $ git pull
So when repo2
updates from repo1
you can simply git pull
in repo3
and you'll get all its commits. And you should use the commands above the dividing line only if you intend to sever the dependency between repo3
and repo2
, otherwise if you'll both pull
, push
upstream and pull -s subtree
it's easy to get into frequent unpleasant merges.