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)
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.
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.
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?
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG