Switching submodule to subtree...

I'm switching from submodules to subtrees. To do this, I've created a topic branch and done the work in there. To get everything working properly, I had to delete the submodule folders entirely from disk. Once I have the subtrees set up in my branch, I can't checkout to move back and forth between my topic branch and the master branch because once I have the submodule re-established, they end up leaving their files as untracked files when trying to switch back to my subtree branch and I have to go and clean them up off of disk again. I'm wondering if this is a known issue and if there's any plans to do anything about it.

1 answer

1 accepted

Hi Micah,

In events like these it's worth raising a JAC ticket so us devs can look at it. I can't say I've experienced this problem though. Are you saying when you switch branch from where your submodules were, to a branch which no longer contains your submodules, that the files from your submodule (not subtree) get left over?


Thanks for the response Kieran. I'll need a quick pointer to opening a JAC ticket (didn't find anything promising on this page or in some web searches). Yes, I'm saying what you state. It seems like in GITs view, it starts with no untracked/modified files, so it is fine with the checkout to the new branch with subtrees in place of submodules, but once it switches its view to that with subtrees, then all the submodule-related stuff appears as untracked files that would get overwritten. So, considered strictly from the end-user's perspective, I see that my working tree is clean, so I expect to be able to switch from this to any arbitrary branch.

Hey Micah,

It's jira.atlassian.comto log a JAC ticket. I'd be happy to help you out from the logged issue if that's OK?

Thanks in advance

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,125 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you