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 vote
Mikael Sandberg Community Champion 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 Champion 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 Champion 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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

573 views 1 2
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you