If you access a code repository over the HTTPS protocol, you must obtain the token that is used to access the code repository before you add code access permissions. This topic describes how to obtain a token that is used to access GitLab. The operations that are performed to obtain the tokens that are used to access other code repositories such as AliyunCode and GitHub are similar to the operations that are performed in this topic.
Prerequisites
You are logged on to GitLab.
Procedure
Click the profile picture in the upper-right corner of the GitLab home page and select Edit profile from the menu. The User Settings page appears.
In the left-side navigation pane of the User Settings page, click Access Tokens.

On the Access Tokens page, configure the parameters. The following table describes the parameters.
Parameter
Description
Token name
The name of the token.
Expiration date
The expiration date of the token.
Select scopes
The permission levels that are granted to the token. You can select read_repository or write_repository.
NoteTo use EMAS Cloud Building, you must at least obtain the permissions to read a code repository.
Click Create personal access token to generate a token.
ImportantAfter the token is generated, you must immediately copy and save the token. After you leave the page, you can no longer view the information of the token.
A token is sensitive information. Keep it confidential.