Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Cannot add existing subtree to SourceTree

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?

7 answers

1 accepted

1 vote
Answer accepted

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.

Deleted user Aug 02, 2017

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.

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

Like # people like this

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!

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 !

This is not what's happenning. It doesn't get to this dialog showing error before.

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.

1 vote
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.
May 21, 2014

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.

This is not the problem. I don't even get to that dialog. Screenshot of the error message.

This is not what's happenning. It doesn't get to this dialog showing error before.

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.
May 22, 2014

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

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.

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.

Same here. Changing manually to the realtive path didn't solve the problem.

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.

I also have this problem

This is not an answer, this is a comment. Please delete this and move it to a comment on the main question.

Like # people like this

+1

same issue

Repro szenario:

0 votes
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.
May 20, 2014

There were a couple of fixes issued, so this shouldn't be happening any more. What version are you on?

I am also on 1.9.2

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events