---
url: /en/guide/git-access.md
description: >
  Explains the Git repository address format on CNB, authentication methods, and
  how to configure credentials for cloning and pushing code.
---
## Git Repository Address

The Git repository address uses the **repository page URL** directly, without adding a `.git` suffix:

`https://cnbprod.alpha.qq.com/group-path/repo-path`

This is the same URL users see when accessing the repository homepage in a browser.
The traditional `.git` suffix format is also supported.

### Explanation

* **Convenience**: You can copy the repository URL directly from the browser address bar
  as the Git address.
* **Traditional Format Support**: The `.git` suffix format is also supported.
* **Consistent Functionality**: Both formats support full Git operations (cloning, pulling, and pushing)
  without any functional differences.

## Authentication Method

Authentication is performed via an **access token**:

* **Username**: Always enter `cnb`.
* **Password**: Enter the access token you have created (supports permission configuration).

For more usage details, please refer to: [Access Token](./access-token.md).

> When connecting with third-party tools (such as IDEs, Git clients),
> enter the token in the password field and `cnb` in the username field.

### Command Examples

The following example shows the complete workflow of cloning and pushing code
using an access token:

```bash
# 1. Clone the repository (you will be prompted for credentials if it is private)
git clone https://cnbprod.alpha.qq.com/group-path/repo-path
cd repo-path

# 2. Commit and push changes
git add .
git commit -m "feat: init"
git push origin main
```

> When prompted for credentials, enter `cnb` as the username and your [access token](./access-token.md) as the password.

### Design Background

* Tokens support fine-grained permission control (read/write or read-only) and can be revoked or
  updated at any time, offering higher security compared to static passwords.
* Using the fixed username `cnb` simplifies authentication, preventing security risks from
  custom username conflicts or weak passwords.

## SSH Not Supported

The platform does not support SSH protocol access for the following reasons:

1. **Higher Security**: HTTPS + tokens support short-term validity and hierarchical permissions,
   making them easier to manage than long-term SSH private keys and revocable at any time.
2. **Lower Barrier to Entry**: No need to generate SSH keys or upload public keys,
   making it suitable for beginners and temporary collaborators.
3. **Anti-MITM**: The SSH protocol is vulnerable to man-in-the-middle attacks over the public network,
   as most users do not verify host key fingerprints on first connection.
   HTTPS's CA trust chain mechanism resolves this issue automatically.
