Clone
This document shows how to clone a Git repository hosted on Buddy to your local development environment.
Cloning
Using HTTPS
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.
- Go to Code and click the Clone button.
- Switch the tab to HTTPS and copy the link:
HTTPS link for cloning
- Open the terminal and run this command to clone the repository:
git clone {BUDDY_GIT_REPO_LINK}
$
- Enter your username (Buddy email address) and password to authorize the operation.
Using SSH
SSH is a secure protocol that allows trusted computers to communicate without involving passwords – a popular method with improved security over HTTPS.
- Go to Code and click the Clone button.
- Switch the tab to SSH and copy the link:
SSH link for cloning
- Open the terminal and run this command to clone the repository:
git clone {BUDDY_GIT_REPO_LINK}
$
Authentication with personal API tokens
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
- Go to My ID settings and switch to API → Personal Access Tokens:
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 and enter your password to create the token.
- Use the button to copy the token to clipboard and return to the token list:
Generated personal API access token
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:
git clone https://{TOKEN}@app.buddy.works/{WORKSPACE_URL_HANDLE}/{PROJECT_NAME}
$
Last modified on January 17, 2022