Git Submodules Moving a submodule If needed, create the parent directory of the new location of the submodule ( mkdir -p new/path/to ). Move all content from the old to the new directory ( mv -vi old/path/to/module new/path/to/submodule ). Make sure Git tracks this directory ( git add new/path/to ).
You can set the submodule to track a particular branch (requires git 1.8. 2+), which is what we are doing with Komodo, or you can reference a particular repository commit (the later requires updating the main repository whenever you want to pull in new changes from the module – i.e. updating the commit hash reference).
I'm afraid the URL for submodules always just points to the repository - you can't specify that you only want a subfolder of a repository, in the same way that git doesn't support "narrow clones" in general.
If you can't live with having the whole repository as a submodule, you could always create a new repository that's cloned from boto and then set up a cron job to:
git fetch
that repository into a directorygit filter-branch
to update a branch where the subdirectory is at the top level. You cannot clone only a part of a repository. This is because git treats the repository as a whole object : when you get it, you get it all.
So, the solution here would be to fetch the submodule in another directory, then use a symlink to achieve your goal.
What you want to do is create a branch in the submodule and move the folder up and delete what you don't need. You can then manage that branch instead. If you want to push up your changes, you should be able to back merge first. Git will know that you moved the files and do the merge successfully.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With