Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 794
Quen Avatar asked Sep 23 '14 01:09

Quen


People also ask

How do I push from local to remote repository?

Push a new Git branch to a remote repo Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch. Continue to perform Git commits locally on the new branch.

How do I add a local repo to SourceTree?

If you already have a repository, you can view it in SourceTree. Click New, then Add Existing Local Repository. Select the repository your wish to add, then click Open. Your added repository appears under Local.


1 Answers

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

like image 179
Neo Avatar answered Oct 16 '22 12:10

Neo