This article covers this topic in depth.
I’ve switched to using git submodules to manage external plugins. Recently I forked the rbet library and added it to a project via git submodules:
git submodule add git://github.com/sbraford/rbet.git vendor/rbet
But wait, I have new changes in my rbet library that I’d like to pull into my app:
git submodule update
No dice.
Git submodules are tied to the specific revision of the external repository at the time of checkout. Once more, with enthusiasm!
Git submodules are tied to the specific revision of the external repository at the time of checkout.
To update rbet to the latest version in this example, I had to do a:
cd vendor/rbet
git remote update
git merge origin/master
Then to make sure these changes get reflected in my main app:
cd ../..
git add .
git commit -a -m “updated rbet to latest”
git push
And presto, we have successfully ninja-unicorned our git submodule.