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

How to create a new remote repo on github using SourceTree

bholm October 30, 2017

Given the time I've spent searching on Atlassian site and not finding anything, I must be asking a rare question. So hopefully this is not something obvious I overlooked.

I have a local git repo on my computer. I am ready to push it out to a remote repo that doesn't yet exist on github. I went into Settings in the top-right corner and selected Remote tab. Then I clicked Add button.

It then asks for Remote name (it doesn't exist so I type in a new name I want to give it on github). Then it wants the URL/path. Below that input is an Optional extended integration section where if you select Github, it provides the github URL. It asks for your username input. If I specify my github account path there, why does it ask for the URL/path above?

This is confusing to me. There is no on screen Help. Searching results in nothing so far. 

2 answers

1 accepted

0 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 30, 2017

You need to create the new repo in Github first, then you can follow these instructions on how to import your local repo into it https://help.github.com/articles/importing-a-git-repository-using-the-command-line/

bholm October 30, 2017

I've reviewed your solution but it doesn't use ST. My question about the URL/Path vs the Optional extended integration section details has not been answered. It seems redundant to me.

I've created a new remote repo on github.com and now want to use ST to "hook it up".

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 31, 2017

The URL/Path is the one you get from Github, and you can either set it up using the steps outlined in link above, or enter it via Sourcetree. They both do the same, it updates the config file for the repository so it knows where the remote is. Looking at the Github instructions compared to Bitbucket is looks like Github needs a bare copy in order be able to import an existing local repository, so using the Settings option in Sourcetree may or may not work.

The optional extended integration allows you to create pull requests directly from within Sourcetree.

bholm October 31, 2017

Hopefully, Atlassian will see the confusing aspect of the Remote tab input fields and provide some clarity through revising the UI or adding help text in the form. For me it appears redundant overlap of requested information unless I'm missing something in my understanding.

0 votes
bholm October 30, 2017

Are you saying there is no way to create a new repo from the ST app?

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 30, 2017

Correct, out of the box you cannot create remote repositories from within Sourcetree, they have to be initiated in Github first. If you want to do it from within Sourcetree you would have to create a script that uses Github's REST API.

Like dmmanley likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events