It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
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)
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
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.
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.
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.
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?
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreSupported 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 groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.