Following these instructions, I created subtree through the terminal. I added a remote for it (hosted at GitHub) and everything has been working as expected on the terminal. However, in Subtree when I try to "add/link" the subtree it keeps complaining that it already exists.
Is there any way to get SourceTree to recognize the subtree without removing it and recreating it through SourceTree?
Kieran Senior's comment fixed the problem for me:
Yeah, this is because it's supposed to be a relative path. The dialog label says "Local relative path" but we don't detect for this at the moment. Unfortunately Git's errors aren't of much help. The Git command lets you carry on regardless.
If it's an existing path (the paths must always be within your main repository directory), then you create a link. Adding a subtree to an existing path yields in a Git error. If it's a brand new subtree then it needs to be a non-existent directory in your repository directory.
We've got a couple of open issues to improve this so when you select a folder using the directory picker (the triple dot button) then it'll yield a relative path, or if it's outside your repo folder then it'll yield an error. I've been meaning to do this but only a couple of people spotted it. That adds two more to my list now.
In your case it looks like the path should be web/sites/all/modules/asset_saver
Cheers
It should be noted that the [...] button next to the "Local Relative Path:" field generates an absolute path instead of the required relative path.
3 August 2017
THIS BUG IS NOW THREE YEARS OLD AND STILL PRESENT.
How about fixing it...
It is intuitive to trust the directory picker. It has taken me hours to solve why every subtree I add crashes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I guess this bug is still there.
For inexperienced users: Do not click the [...] and select the path of the subtree project.
Simple enter the folder name of the subtree project (not a path in the form of c:\my project\subtree project) into the space provided. I suggest to select a folder name without spaces and special characters.
Baris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
2022 BUG STILL THERE, don't click [...] just write the folder/path name you want to create and don't pick it via explorer...god this has been so frustrating!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I spend more than an hour trying to add a subtree because of the "source path/url" and "Local relative path". I use source tree 1.8.3.0
Thanks to God, it worked very well in the end. But I had to create the subtree as follow :
1 "Local relative path": It has to be relative to the main project
2 "Local relative path": it has to have linux slashes ( / ) ad not backslashes ( \ ), else the git command don' t work.
3 "Source path / url" has to be a local path on my computer, it didn't worked with a private repository on bitbucket...
Well, that part of sourcetree need some debugging, but at least now it works very well.
Thank you for the fantastic Source Tree !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is not what's happenning. It doesn't get to this dialog showing error before.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is not an answer, this is a comment. Please delete this and add it as a comment on the answer you're responding to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it's asking to create a link, you simply say "Create Link". All this does is create a link between the specified repository and that sub-folder of your repository within SourceTree. It's metadata stored by SourceTree, nothing more. This is used so you can perform subtree actions without having to specify the remote each time.
Subtree is very disconnected in that no metadata is stored for each subtree, so we store it for you so you can perform actions quickly. If you were to do this at the terminal you'd have to specify the remote each time, with SourceTree you don't.
I'm assuming we're talking about the above dialog. The message tells you what's happening and that it won't affect anything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is not what's happenning. It doesn't get to this dialog showing error before.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, this is because it's supposed to be a relative path. The dialog label says "Local relative path" but we don't detect for this at the moment. Unfortunately Git's errors aren't of much help. The Git command lets you carry on regardless.
If it's an existing path (the paths must always be within your main repository directory), then you create a link. Adding a subtree to an existing path yields in a Git error. If it's a brand new subtree then it needs to be a non-existent directory in your repository directory.
We've got a couple of open issues to improve this so when you select a folder using the directory picker (the triple dot button) then it'll yield a relative path, or if it's outside your repo folder then it'll yield an error. I've been meaning to do this but only a couple of people spotted it. That adds two more to my list now.
In your case it looks like the path should be web/sites/all/modules/asset_saver
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That fixed the problem. The reason I didn't think about entering a relative path is because I just used the [...] (browse) button and it generated an absolute path. I assumed that whatever it generated would be valid.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It does not work here.
My dir is as follows:
ProjectDir/subtrees/AFNetworking
When trying to link the subtree to Sourcetree, I use:
subtrees/AFNetworking
as relative path but I get the "already exists" error shown in the original question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same here. Changing manually to the realtive path didn't solve the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You guys may want to start a new question since it seems like this solution isn't working for you. It may be that the Atlassian members already see this question as solved and so are ignoring further comments on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is not an answer, this is a comment. Please delete this and move it to a comment on the main question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There were a couple of fixes issued, so this shouldn't be happening any more. What version are you on?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.