A
A
AlexanderY2015-05-13 13:45:39
git
AlexanderY, 2015-05-13 13:45:39

What is the correct way to use git submodules in team development?

Today we faced one inconvenience.
Our project on Kohana. Remote git repository. Several developers, each writes something, commits, and sends it to the repository (push).
Today I needed to install the HTML Purifier module and I followed the recommended path: I added it as a submodule

git submodule add git://github.com/shadowhand/purifier.git modules/purifier
git submodule update --init --recursive

Commited: Git reported that the modules/purifier directory was added. I started it - but after git pull , other developers got only this directory, but not the files inside. Each of them had to run git submodule update --init --recursive . Similarly, I had to run this command on the server, in a remote repository.
I expected that all new files would be added to the commit as usual and sent to the remote repository. What did I do wrong? How to work with submodules in the future?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2015-05-13
@v_decadence

They did everything right and yes, you need to do git submodule update --init --recursive in each new repository.
In the future, do git submodule update after changing the commit in the submodule by someone else in order to checkout the necessary files in your copy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question