Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

SourceTree Automatically Initializes Git SubModules

Matthew Eagy December 4, 2014

We currently use a few Atlassian products including JIRA, and Stash for hosting our Git repositories. Some of our developers also use the SourceTree application. We've recently implemented submodules into one of our main repositories. The developers that use the main repository do not have read/write access to the repositories that are linked using the submodules. This results in errors and occasionally some strange behavior when they perform a pull using SourceTree.

Problem: It appears that SourceTree always performs a 'submodule update --init --recursive' when communicating with the central repository (pull, fetch, etc...).

I've read a few threads on here, even one where someone said you can go into settings in the upper right corner of the repository settings, click advanced, and there is an option to disable the submodule update. I was unable to find such an option, does it exist? If not then when can we expect Atlassian to fall in line with the default Git behavior of ignoring the submodules by not auto-initializing them?

Thanks

1 answer

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 4, 2014

There is no option to switch this off (unless tucked away in a config file somewhere).

The situation you describe (not having access to repos mapped as submodules in the repo one is using) is quite rare. SourceTree aims to be easy and foolproof and the auto-initialising/updating of submodules is very useful for the usual case of having access to the submodules. (That said, it should be possible to disable this.)

Try Git Extensions, it offers a choice about this behaviour.

Matthew Eagy December 5, 2014

Hi, Thanks for the reply. By "tucked away in a config file", I'm assuming you mean a SourceTree config file in which case it would be nice to have the option even at that obscure level. It may be rare as you stated, however there is a reason that Git changed the default submodule behavior and I can only assume that the use case may not be as rare as you initially stated. In any case my company spends a lot of money on Atlassian products and it would be nice to at least have the feature. Atlassian, can we have a feature to disable the automatic submodule initialize? I wouldn't mind if the default was to initialize, as long as we had the ability to turn it off. I'm sure some of our developers are going to stop using SourceTree because of this.

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 7, 2014

There are quite many issues already for this kind of thing in Atlassian's Jira: https://jira.atlassian.com/browse/SRCTREEWIN-937?jql=project%20in%20%28SRCTREEWIN%2C%20SRCTREE%29%20AND%20text%20~%20submodule Find the right one and vote for it or if there is none that fits your needs, you can create one.

charleshan July 1, 2015

I can't believe that Atlassian would even think about implanting a different behaviour as git and not have the option to turn it off. Pulling from Sourcetree is not the same as git pull.

Saeven November 18, 2015

I'm in the same boat. Need an option to perform a "true" pull, and get the code that's in the branch. The client (SourceTree) shouldn't be deciding what gets pulled or no.

Mike Friedrich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 7, 2017

and it is still a problem 2 years later... :(

Andrey Prokhorov August 14, 2017

This is fixed in version 2.1.10.0:

"Recursive submodule actions are now disabled by default. See Tools/Options/Git"

https://www.sourcetreeapp.com/update/windows/ga/ReleaseNotes_2.1.10.0.html

Matthew Eagy August 14, 2017

Excellent! Glad to see this is FINALLY fixed :)

Murray Rowan August 31, 2017

Well, sort of. The recent fix essentially allowed removing the `--recursive` flag from the call below:

`submodule update --init --recursive`

...but I still get this bug with submodules trying to be re-init-ed on every pull (i.e. the `--init` flag is the problem.)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events