Port subtree configuration between clients...

Micah Koffron December 11, 2013

I've set up subtrees with the new support in SourceTree, but if I clone the repository again to another location on my machine (simulating a second user), none of the subtree configuration appears. Is there planned support for this and is there anything I can do in the meantime? (for example, if I knew where the subtree information was stored, I'm guessing I could replicate the info myself)

2 answers

1 accepted

1 vote
Answer accepted
KieranA
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 12, 2013

Hi Micah,

The subtree concept on a whole revolves around the subtree being completely 'detached' from your repository. By this I mean that your Git repository knows nothing about the subtree. It holds no metadata to the location it came from, or its name et cetera. This is a good thing because it avoids confusing configurations that led to many of the problems people experienced using submodules.

SourceTree saves the subtree metadata in its own configuration file in the 'sourcetreeconfig' file in the '.git' folder, but this isn't committed to your git repository as it shouldn't be.

Generally you'd have to setup your links again which SourceTree allows as the folder will already exist. You can just create a new subtree but specify the existing directory as a result of the subtree which will then allow you to create a link. This is partly why this feature exists, for cases like these.

Other than that, it's impossible for SourceTree to know because Git repositories don't store the information required for SourceTree to be able to set up the subtrees.

Cheers

Micah Koffron December 12, 2013

Thanks Kieran. I pretty much understood that the subtree concept was a bit of an artificial construct outside of GIT, but wanted to be able to capture/propagate the configuration in some reasonable way. Looking at the sourcetreeconfig file, it looks like this will serve my purposes. Might be nice in the future if SourceTree had some way to help with this... maybe just give you an option to store and use this info in a tracked config file at the root of the repository or something like that.

Andrew Christensen March 24, 2015

Isn't the point of the subtree that the code in the subtree can still pull updates from its original remote? Without saving the metadata then the project in which the subtree was first set up can see these changes, but cloned repos cannot. Very confusing.

billyquith May 24, 2016

I also would like to propagate the subtrees between clients. Could you store the data somewhere textually so that it could be imported to another client? Bit annoying, having to enter it all again.

0 votes
billyquith May 25, 2016

One way to solve this would be to support git-subrepo: https://github.com/ingydotnet/git-subrepo

This is how I can share subtrees between repos using the command-line. Perhaps if this were present you could use the metadata instead of your own format. And perhaps export to this format? (git subrepo init xxx).

Perhaps you could incorporate this tool into your own command-line so this works for everyone?

Brendan Simon June 12, 2018

WOW.  git-subrepo sounds awesome (reading the dot point features).  If the feature list is accurate then in claims to solve most/all of the issues using submodules and subtrees.

Is there any reason why this hasn't been adopted by the git and/or Atlassian community?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events