# Configuring a Git client

> Set up a Git client such as TortoiseGit or command-line Git to work with a repository stored on your hosting account.

Source: https://helpcenter.ruachost.com/developers/version-control/configuring-a-git-client/

Learn how to set up a client on your computer to work with a Git repository stored on your Ruachost account. This assumes you already have a repository created and basic Git knowledge.

### Microsoft Windows

A popular Git client for Windows is **TortoiseGit**. You also need **Git for Windows** installed.

#### Steps to Install and Configure TortoiseGit

1. **Download TortoiseGit:**\
   Visit <https://code.google.com/p/tortoisegit>.\
   Click **Download TortoiseGit** and save the `.msi` file.
2. **Install TortoiseGit:**\
   Double-click the `.msi` file and follow the prompts.
3. **Download Git for Windows:**\
   Visit [http://msysgit.github.io](http://msysgit.github.io/).\
   Click **Download** and save the `.exe` file.
4. **Install Git for Windows:**\
   Double-click the `.exe` file and follow the prompts.

```
Note:
TortoiseGit may detect existing PuTTY SSH sessions. You can use TortoisePlink to integrate TortoiseGit with your existing PuTTY sessions.
```

#### Cloning a Repository

1. Right-click on the desktop or a folder and select **Git Clone**.
2. In the URL box, type the repository URL:

```
ssh://username@example.com/home/username/repository
```

- Replace `username` with your Ruachost account username.
- Replace `example.com` with your domain name.
- Replace `repository` with the path to your repository.

**Non-standard SSH port:**

```
ssh://username@example.com:7822/home/username/repository
```

Click **OK** to clone the repository.

### macOS and Linux

The `git` command line client is typically the fastest way to work with Git, though GUI clients are also available.

#### Cloning a Repository on a Non-standard Port

If SSH on your server uses a custom port, include it in the URL. For example, for port 7822:

```
git clone ssh://username@example.com:7822/home/username/repository
```

- Replace `username`, `example.com`, and `repository` with your account details.

#### Configuring SSH for Easier Access

You can define the SSH port and user in your `~/.ssh/config` file:

```
Host example
    Hostname example.com
    Port 7822
    User username
```

- `Host` can be any alias you choose.
- After this, you can clone the repository using the alias:

```
git clone ssh://example/home/username/repository
```

#### Using SSH Keys

To avoid typing a password each time, you can set up SSH keys.

- For instructions, refer to the guide on setting up SSH keys.

This setup allows you to interact with your Ruachost Git repository efficiently from Windows, macOS, or Linux.
