Authentication
Cloning
To clone a repository to your local environment, go to the Code tab and click the Clone button:
Image loading...Clone button on repository view
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.
- From the clone view, switch the tab to HTTPS and copy the link:
Image loading...HTTPS authentication details
- Open the terminal and paste the URL to clone the repository:
git clone BUDDY_GIT_REPO_LINK
$
- Enter your username (Buddy email address) and password to authorize the operation.
SSH keys
SSH is a secure protocol that allows trusted computers to communicate without involving passwords – a popular method with improved security over HTTPS.
- From the clone view, switch the tab to SSH and copy the link:
Image loading...SSH authentication details
- Open the terminal and run this command to clone the repository:
git clone BUDDY_GIT_REPO_LINK
$
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
- Go to My ID settings, switch to API → Personal Access Tokens and click the
+
icon to add a new token. 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...Generated 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}
$
Sep 23, 2024