0

I have a branch in my Bitbucket repo that contains an additional submodule that is not contained in the master. The submodule has been added to the .gitmodules file within the new feature branch. When I clone the master, and then pull the new branch, a folder is created for the added submodule, but it is empty, and the .gitmodules file is never updated from the file on the new feature branch.

How do I properly pull a branch that contains a submodule not included in the current branch of the local repo?

pavuxun
  • 411
  • 2
  • 15
  • Possible duplicate of [How to git checkout commit and have submodules update to that commit?](https://stackoverflow.com/questions/45624393/how-to-git-checkout-commit-and-have-submodules-update-to-that-commit) – phd Jul 30 '18 at 13:52
  • https://stackoverflow.com/a/44529991/7976758 – phd Jul 30 '18 at 13:52

1 Answers1

1

You will have to do a git submodule init for the first time after cloning the repository.

To keep the submodules up to date use git submodule update.

Here is the link to the documentation.

Mamtha Soni K
  • 895
  • 6
  • 9