Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding git submodule into the root of the repository?

I want to keep my Vim plugins up-to-date with git by using github repos as submodules with the help of pathogen. Everything is well except pathogen itself.

For example, I have a repository in ~/.vim, at pathogen's repo has autoload directory in its root: <pathogen repo>/autoload.

Is it possible to make a git submodule so that pathogen's autoload goes into ~/.vim?

~/.vim/autoload/pathogen.vim
like image 218
Alex B Avatar asked Mar 08 '11 13:03

Alex B


People also ask

How do I change my submodule location?

Enter the master repository's . git/modules directory, and find the directory corresponding to your submodule. Edit the config file, updating the worktree path so that it points to the new location of the submodule's working directory.

Is using git submodules a good idea?

Git submodules may look powerful or cool upfront, but for all the reasons above it is a bad idea to share code using submodules, especially when the code changes frequently. It will be much worse when you have more and more developers working on the same repos.


1 Answers

Clone the submodule into a subdirectory and symlink it's contents.

For pathogen, I also explicitly blacklisted itself (in the bundle directory) to prevent it from self-sourcing.

like image 114
tlvince Avatar answered Sep 23 '22 09:09

tlvince