Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pulling git submodules with TortoiseGit

I'm using TortoiseGit to maintain git repository. We have one repo with multiple submodules in each. Everything works fine but when I'm trying to pull main repo, submodules aren't updating. I must pull every submodule one by one.

Is there an option in tortoise to use only one pull command from menu to update all changes in all submodules for repo?

like image 445
David Marks Avatar asked Apr 17 '13 11:04

David Marks


People also ask

Does Git pull pull submodules?

Once you have set up the submodules you can update the repository with fetch/pull like you would normally do. To pull everything including the submodules, use the --recurse-submodules and the --remote parameter in the git pull command .

How do I use TortoiseGit with GitHub?

Use the TortoiseGit Puttykey generator to create a new keypair add your public key to GitHub. Clone/create a new repository. In thee Tortoise repository settings, set your fullname and email. Then in remote menu under the Git configuration menu enter your clone URL and select your PuTTY key.

What does Git pull -- recurse submodules do?

If you pass --recurse-submodules to the git clone command, it will automatically initialize and update each submodule in the repository, including nested submodules if any of the submodules in the repository have submodules themselves.


2 Answers

(git 1.8.2 or later)

  1. git pull

  2. git submodule update --merge --remote

Here are the corresponding screens of TortoiseGit to perform the task.

enter image description here

enter image description here

enter image description here

like image 189
linquize Avatar answered Oct 12 '22 00:10

linquize


I was also able to just right-click on the folder that was the submodule and do a normal Git Pull on that folder.

This pulled just the submodule - so slightly simpler than the (admittedly great) answer above for a single submodule.

like image 33
Ian Grainger Avatar answered Oct 12 '22 00:10

Ian Grainger