Quen
Quen

Reputation: 111

How to push a local repository to remote use "SourceTree"

As the title says, I use GIT by SourceTree.

My question is how can I create a remote repository by SourceTree directly ?

For example, I have a directory named "Test" at local. There is some text file in "Test" and the remote server doesn't have any repository.

Now, I need push "Test" to server. Is there any way to create a remote repository by SourceTree?

Not using command line or other way, Just use SourceTree(Which button or how setting... etc. ?) (I found a command line is "scp -r LocalFileName RemoteFilePath".) Hope them has same effect.

p.s. I'm using SSH

Upvotes: 11

Views: 20587

Answers (2)

Jesse H.
Jesse H.

Reputation: 733

Worked With

macOS Catalina 10.15.7
Sourcetree Version 4.1.2(238)

This is a very old question but the question remains relevant as the interface for this is still unintuitive in 2021.

Scenario: You started a repository on your local machine and want to create a remote link after the fact.

⚠️ Do NOT create the remote manually on the browser and then try to link. Big headache.


Instructions

  1. Open Sourcetree
  2. Go to Window > Show Remote Hosted Repositories
  3. Right-click on the name of your local repo
  4. Follow the rest of the prompts to completion

Upvotes: 1

Neo
Neo

Reputation: 4880

I tried this on SourceTree 1.6+

Click View -> Hosted Repositories Here you will see all your remote repositories.

Click the buttom at the bottom Create New Repository... This will allow you to create a new repo on Bitbucket. Enter name and create your repo.

Once you see your new repository in the list, right click on it and click Copy Project URL to Clipboard

Now use this URL in the URL/Path field for the Remote details when you add a remote to your local repository.

enter image description here

Upvotes: 10

Related Questions