# submodule questions

1 messages from 2010-05-28 to 2010-05-28. Participants: Cliff Brake.
Thread: https://gitlist.dev/t/23935

## Cliff Brake, 2010-05-28 20:45

Subject: submodule questions
Message-ID: <AANLkTilWHMkf5e7PBgnrI1tsGUYOldnv6AWKU3GG02u2@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTilWHMkf5e7PBgnrI1tsGUYOldnv6AWKU3GG02u2%40mail.gmail.com

```
Hello,

I've been trying to understand git submodules.

1) What is the purpose for the submodule lines in .git/config?
2) should 'git submodule sync' update the .git/config with submodule
info, or what exactly does 'git submodule sync' do?

I read the following:
http://therealadam.com/archive/2008/05/08/changing-git-submodule-urls/
 The author claims that:

    * Fork/create your own version of the submodule in question
    * Change the URL for the submodule in .git/config and .gitmodules
    * Cross your fingers and hope for the best

Does not work, but in my experience it does.  On machine #1, I did the
following:

1) created a new branch in the submodule dir, pushed the changes to a new repo.
2) modified .gitmodules to point to the new repo
3) push the changes in the parent repo

On Machine #2:

1) git pull
2) git submodules sync
3) git submodules update

Everything seemed to work.  However, the .git/config submodule entry
still points to the old location, even though 'git submodule update'
seemed to work.  Hence my confusion about what .git/config submodule
entries are for.

Thanks,
Cliff

```
