Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: How to connect SourceTree to my Git-Enabled-Web-Hosting via SSH?

I'm using SourceTree on Windows and I'm already successfully pushing my repository to BitBucket.

I would like to do the same, but instead of pushing to BitBucket, I would like to push to my Web Hosting Account instead (i.e. "1&1 Shared Hosting").

My 1and1 account provides SSH access and has git already installed. I tried to connect to the SSH using PuTTY and it works. When I enter "git" I can see all the available git commands.

I would need to know:

  1. How to connect SourceTree to the SSH? I have a domain, username and password, however I don't see such fields in SourceTree or Pageant, which requires a special file format ".ppk".

  2. Once connected to the SSH, How to create the repository remotely on my 1&1 account?

  3. Once the repository exists on my hosting, How to add it as a Remote Repository so I can push to it?


Note: This question is about the SourceTree-Windows software, which is itself a graphic user interface for most git functions – please don't reply with command line instructions.

Thank you very much!

like image 281
Community Avatar asked Jul 20 '13 15:07

Community


People also ask

How do I use SSH in SourceTree?

From Sourcetree, open the PuTTY Key Generator dialog by going to Tools > Create or Import SSH Keys. Click Load, navigate to your SSH folder, and click the private key. Make sure you're looking at All files if you don't see your private key. Enter your passphrase for the SSH key and click OK.


2 Answers

The syntax that you have to use in the "Source / URL" field is the following :

ssh://<user>@<server_name>/<git_repository_path>

For example :

ssh://[email protected]/opt/git/project.git

(if the repository does not exist yet on the remote server, then you can create an empty one with the following commands :)

$ mkdir -p /opt/git/project.git
$ cd /opt/git/project.git
$ git init --bare
like image 186
Orabîg Avatar answered Oct 02 '22 04:10

Orabîg


  1. The SourceTree documentation has an article on that
  2. As you know repositories are not created remotely. You have to login to your server and create repository there using your server git commands
  3. Select your repo in SourceTree. In the main menu Repository>Repository Settings. There you can add remote repository. The default one is usually named 'origin'
like image 34
Eugene Ryzhikov Avatar answered Oct 02 '22 02:10

Eugene Ryzhikov