It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to create a new remote repo on github using SourceTree

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 Oct 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/

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 Oct 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.

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.

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

Mikael Sandberg Community Leader Oct 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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,907 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you