Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add remote repository using sourcetree

I'm using a Mac and I'm new to Bitbucket and Sourcetree. I want to push my local repository to a remote repository. So in Sourcetree, I pressed "New", "clone from Url" and I pasted the url right from our remote repository. When I press enter, it says the url isn't valid.

I kinda rushed through the installation, so maybe that could be it.

like image 809
Ezra Bekele Avatar asked Jul 13 '17 22:07

Ezra Bekele


1 Answers

I'm assuming your local folder is initialized with git.

There are two ways you can achieve this:

Via Sourcetree app:

  1. In Sourcetree, check the left pane for Remotes

enter image description here

  1. Right click on it and select New Remote

enter image description here

  1. Insert the link to your repo and click on OK

  2. Once that's done, just do a Pull from your branch and commit your changes to the repo

Via Terminal (the easy way)

  1. cd /path/to/your/repo
  2. git remote add origin https://remote_url_of_your_repo
  3. git push -u origin master
like image 110
Sahan Serasinghe Avatar answered Oct 02 '22 22:10

Sahan Serasinghe