Accessing a SourceCraft repository with a personal access token (PAT)
To authenticate in SourceCraft and access repositories, you can use a personal access token (PAT).
To access a SourceCraft repository with a personal access token:
If you no longer need token-based access, delete the token.
Create a personal access token
- Open the service home page.
- In the left-hand panel, click
Home and go to Access → Personal access tokens. - On the Personal access tokens page, click Generate new token:
-
In the Token name field, specify a token name.
-
Optionally, in the Description field, enter a description for the token.
-
Select a token expiration date from the Expiration drop-down list.
To set a custom expiration date, select Custom and specify the date when the token will expire.
-
Under Repository access, select the repositories to grant access to:
-
All repositories: Access to all your repositories.
-
Only selected repositories: Access to selected repositories only, no more than 10.
In the Organization field, select the organization hosting your repository. In the Repository field, specify a name for the repository.
To add another repository, click
Add another repository.
With a personal token, you will also have read access to all public repositories.
-
-
Under Permissions, select the repository roles that will be granted using the token.
-
- Click Generate token.
- In the window that opens:
-
Copy
the personal token and save it in a secure location.Warning
You will not be able to view the personal token value in the SourceCraft interface again.
-
Click Close, I’ve copied the token.
-
Clone the repository
-
In the top-right corner of the repository page, click
Clone. -
Copy the
link for cloning the repository from the HTTPS field. -
In the terminal, run this command:
git clone <link_for_cloning_repository>
-
Enter a username.
-
Specify the personal token as the password.
-
Go to your cloned repository:
cd <repository_name>
Deleting a personal access token
- Open the service home page.
- In the left-hand panel, click
Homeand go to Access → Personal access tokens. - On the Personal access tokens page, click
next to the personal token you want to delete. - Click I understand, delete this token.