Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how can i make submodule update when i switch to a different commit in the parent repo in sourctree?

Farhad Majdeteimouri
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 6, 2023

I have nested submodules in my project and when i switch to a different commit on the parent repo the submodules do not update, I tried checking the "recursive" setting in the Options menu, but it did not help!

1 answer

0 votes
Martin Runge
Community Champion
August 30, 2026

Hi @Farhad Majdeteimouri

Welcome to the Atlassian community!
Since this thread is from 2023, is it still relevant for you?

If yes, this is what I would try. The "recursive" checkbox in Sourcetree applies to clone and fetch, not to checkout, which is why nothing happened for you. Check out in Git does not touch submodules unless you tell Git to do so globally.

I would set this once in a terminal (the setting only takes effect for the Git installation Sourcetree actually calls):

git config --global submodule.recurse true

Sourcetree uses your system Git, so after that, a checkout of a different commit also updates the submodule working trees, including nested ones.

Cheers,
Martin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events