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

Warning
Users with 2FA can no longer use their username/password to authorize Git operations over HTTPS. We recommend using personal API token authentication instead.

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.

  1. From the clone view, switch the tab to HTTPS and copy the link:

Image loading...HTTPS authentication details

  1. Open the terminal and paste the URL to clone the repository:
bash
git clone BUDDY_GIT_REPO_LINK $$
  1. 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.

Hint
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.
  1. From the clone view, switch the tab to SSH and copy the link:

Image loading...SSH authentication details

  1. Open the terminal and run this command to clone the repository:
bash
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

  1. Go to My ID settings, switch to APIPersonal Access Tokens and click the + icon to add a new token.
  2. 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.
  3. Click Add a new API token.
  4. 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:

bash
git clone https://{TOKEN}@app.buddy.works/{WORKSPACE_URL_HANDLE}/{PROJECT_NAME} $$

Last modified on Sep 23, 2024