---
title: "Setting Up to Work Together"
description: "How to get your code to your Space"
canonical_url: "https://docs.pairspaces.com/working-together/collaborating/setting-up"
markdown_url: "https://docs.pairspaces.com/working-together/collaborating/setting-up.md"
content_type: "documentation"
---

# Setting Up to Work Together

How to get your code to your Space

This section assumes you've completed [Getting Started](https://docs.pairspaces.com/getting-started/quick-start.md) and [Spaces](https://docs.pairspaces.com/spaces/overview/spaces.md) and that you have a Cloud Space running.

## Sync Code from Your Local Machine

To sync code between your local machine and your Cloud Space, PairSpaces uses SSH Agent Forwarding. When you run `git clone ...` from your Space, SSH running in your Space forwards the authentication request from your Space to your local machine. Your local SSH agent will use the correct private key to authenticate the request and you will be able to sync code from your remote repository without storing any keys in your Space.

Read more about Agent Forwarding from [OpenSSH](https://www.openssh.com/features.html).

### Configure SSH on your Local Machine

The SSH agent running on your local machine needs to know which key to use to authenticate requests forwarded from your Space. Use the `ssh-add` command to add the key that authenticates with your private repository, e.g., GitHub.

#### Linux, macOS, and Windows (WSL)

```sh
> ssh-add /path/to/your/key
```

#### Windows PowerShell

```powershell
> ssh-add /path/to/your/key
```

You can confirm your key is available to your SSH agent on your local machine using `ssh-add -L`, whose output will describe the key you just added.

### Clone a Repository in Your Cloud Space

Use `pair spaces connect SPACE_NAME` to access your Cloud Space using your favorite Terminal app. (Use `pair spaces list` to list your spaces and their `SPACE_NAME`s.)

```sh
> git clone git@github.com:my_organization/my_repo.git
Cloning into 'my_repo'...
The authenticity of host 'github.com (140.82.112.3)' can't be established.
ED25519 key fingerprint is SHA256:....
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
remote: Enumerating objects: 3613, done.
remote: Counting objects: 100% (796/796), done.
remote: Compressing objects: 100% (306/306), done.
remote: Total 3613 (delta 553), reused 580 (delta 484), pack-reused 2817 (from 1)
Receiving objects: 100% (3613/3613), 17.37 MiB | 34.94 MiB/s, done.
Resolving deltas: 100% (2206/2206), done.
```

You now have a copy of your repository available from your Space.

### Install Dependencies

You can install programming environments and dependencies that are required by your application.

### Clone a Repository in Your Local Space

There is nothing to do here, because your Local Space is a directory on your machine with everything set up already.
