Cloning
Cloning a repository
Cloning a repository allows you to download all files, commit history, and branches from Buddy to your computer, enabling you to work on the code.
To clone a repository to your computer:
- Go to the Code tab in your Buddy project.
- Click the Clone button.
Image loading...
- Choose your preferred authentication method:
- SSH
- HTTPS
- Personal Access Token
Each method provides a secure way to interact with your Git repository using git clone
.
Image loading...
SSH keys
SSH is a secure protocol that allows trusted computers to communicate without involving passwords – a popular method with improved security over HTTPS.
To clone your repository over SSH, you must add your public SSH key to Buddy. You can manage your SSH keys in your account's SSH key settings.
SSH access configuration
If you haven't added an SSH key yet, complete the following steps before cloning the repository:
- Click Manage Git SSH keys or navigate to Security
- Go to the Git SSH keys section
Image loading...
- Click the + icon, then choose one of the options::
- Add SSH key – if you already have your own public key
- Generate SSH key – if you want Buddy to generate a new key automatically
Image loading...
Generating a new key
If you choose the Generate SSH key option, a form will appear:
Image loading...
You can optionally set a passphrase (a password protecting the key). If you don't set one, the key will work without prompting for a password.
After clicking Generate & download key, Buddy will generate a .zip
package containing the private and public key.
Key package usage
Image loading...
- Unzip the files and place them in the
.ssh
folder in your home directory. - If the
.ssh
folder doesn't exist, create it manually. - On macOS/Linux systems, set the file permissions as follows:
bashchmod 600 ~/.ssh/id_rsa
$
Cloning via SSH
Once the SSH key is configured, you can clone the repository using the command:
bashgit clone BUDDY_GIT_REPO_LINK
$
HTTPS protocol
Interacting with your repository over HTTPS works even if you're behind a firewall or using a proxy. Certain interactions, such as pulling or pushing, require you to provide your Buddy email and password.
Cloning via HTTPS
- From the clone view, switch the tab to HTTPS and copy the link:
Image loading...
- Open the terminal and paste the URL to clone the repository:
bashgit clone BUDDY_GIT_REPO_LINK
$
- During the cloning process, Git will ask you for your Buddy usernanme and password (if you are using 2FA use the token).
Personal API token authentication
You can use personal API token authentication in Buddy-hosted repositories to clone and push to your repository from the application level using the Buddy API.
Authenticating with a token also significantly increases security, as you no longer need to send credentials in your requests.
Generating a token
- Click Manage personal access tokens or navigate to Security
- Scroll to the Personal Access Tokens section and click +
- Specify the name of the token and select the scopes :
- To provide read-only access, which allows cloning and pulling, the token must have the
Read repositories
scope. - To allow pushing changes to the repo, the token must have the
Write to repositories
scope, which includes the read-only scope by default.
- To provide read-only access, which allows cloning and pulling, the token must have the
- Click Add a new API token.
- Use the button to copy the token to clipboard and return to the token list
Image loading...
Cloning with a personal API token
You can clone your repository over HTTPS using a personal API token. When interacting with your repository, pass the token as the username - you don't need to provide a password.
For example, run this command to clone your Buddy-hosted repo:
bashgit clone https://{TOKEN}@app.buddy.works/{WORKSPACE_URL_HANDLE}/{PROJECT_NAME}
$
Last modified on May 20, 2025