Community
Community

Reputation: 5072

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!

Upvotes: 14

Views: 31912

Answers (2)

Orabîg
Orabîg

Reputation: 11992

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

Upvotes: 11

Eugene Ryzhikov
Eugene Ryzhikov

Reputation: 17359

  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'

Upvotes: 1

Related Questions