7

How to update submodules, and with which Git client?

I am currently working with GitKraken.. but it is not friendly to work because you have to open each submodules (one by one) to update 'em and go back git main module and update all submodules.
We are using this workflow (commit, pull and push) for each submodule: is that right?

A Google search did not yield any conclusive answer.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
sealabr
  • 1,593
  • 3
  • 19
  • 28
  • [Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.](https://stackoverflow.com/help/on-topic) – JDB Nov 22 '17 at 20:02

1 Answers1

4

As I illustrated here, the Git command line remains the best (and most complete) option

git config pull.rebase true
git config rebase.autoStash true
git config fetch.recurseSubmodules true

Then, a simple git pull would be enough to update your current branch as well as all the submodules.
Make sure your submodules are tracking a branch, and I have detailed in "", you can do a git submodule update --remote --merge at any time.
You have also the command git submodule foreach to execute commands inside submodules.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250