Skip to content

Gitee — A Domestic Code Hosting Platform for China

Gitee — A Domestic Code Hosting Platform for China

Section titled “Gitee — A Domestic Code Hosting Platform for China”

This section introduces Gitee (also known as “码云”), a code hosting platform based in China that offers functionality similar to GitHub. It is particularly useful for IoT developers working within mainland China, and covers common workflows when using Gitee with the Trae IDE.

After completing this section, you will be able to:

  • Create a Gitee repository
  • Configure Gitee credentials in Trae IDE
  • Use Git credential helpers to store Gitee authentication
  • Authenticate with Personal Access Tokens (PAT) on macOS

Before starting this section, make sure you have:

  • Completed the Git Version Control Basics section
  • Installed Trae IDE
  • (Optional) A Gitee account

Gitee (https://gitee.com) is a code hosting platform launched by OSChina. It provides features similar to GitHub, with several advantages for developers in mainland China:

  • Fast access: Servers are located in China — no VPN required
  • Free private repositories: The free tier includes private repos
  • Domestic cloud integration: Easier integration with Alibaba Cloud, Tencent Cloud, etc.
  • Chinese-language UI: Fully localized interface

Note for international readers: If you are outside mainland China, you will likely use GitHub instead. The Git workflows described here apply equally to GitHub — simply replace gitee.com with github.com in the examples below.

Trae IDE supports standard Git operations and can connect to Gitee repositories:

Log in to Gitee → Click ”+” in the top-right corner → New Repository → Fill in name, description, choose public/private → Create.

After creation, you will get a repository URL:

https://gitee.com/your-username/repo-name.git

Open the terminal in Trae and run:

Terminal window
git clone https://gitee.com/your-username/repo-name.git
# Or use the "Source Control" panel in Trae → "Clone Repository" → paste the Gitee URL

Trae’s AI features (Agent mode) can automatically perform Git operations including git add, git commit, git push, and git pull.

To enable this, make sure:

  1. Git user info is configured:

    Terminal window
    git config --global user.name "Your Name"
    git config --global user.email "your-email@example.com"
  2. Gitee credentials are configured (see below)

  3. The working directory is a valid Git repository: Trae’s Agent auto-detects this. If not, run git init or git clone first.

Tip: In Trae’s AI mode, you can use natural language commands like:

  • “Commit with message ‘Add temperature sensor driver’”
  • “Push to remote”
  • “Pull latest changes”

When using HTTPS, each push/pull requires username and password. Use Git’s credential helper to store them:

Terminal window
git config --global credential.helper osxkeychain

After configuration, the first git push/git pull will prompt for credentials (use your PAT as the password — see below). Credentials are then saved in the macOS Keychain.

Persistent File Storage (General Solution)

Section titled “Persistent File Storage (General Solution)”
Terminal window
# Stores credentials in plaintext — use only on personal machines
git config --global credential.helper store
Terminal window
# Use credential store only for Gitee
git config --global credential.https://gitee.com.helper store

Authenticating with Personal Access Tokens (PAT) on Mac

Section titled “Authenticating with Personal Access Tokens (PAT) on Mac”

Since 2022, both Gitee and GitHub no longer support account passwords for HTTPS Git operations. Use a Personal Access Token instead.

  1. Log in to Gitee → Avatar → Settings
  2. Left menu → Security Settings → Personal Access Tokens
  3. Click “Generate New Token”
  4. Add a description (e.g., “Trae IDE development”)
  5. Select scopes (recommended: projects, git_hooks, hooks, pull_requests)
  6. Click Submit — copy the token immediately (it is shown only once!)
Terminal window
git push
# When prompted:
# Username: your Gitee username
# Password: paste your PAT
Section titled “Option B: Store PAT in Keychain (Recommended)”

Combined with osxkeychain:

Terminal window
git config --global credential.helper osxkeychain
# Trigger a push, enter PAT when prompted — it will be saved automatically
echo "test" > test.txt
git add test.txt
git commit -m "Test PAT authentication"
git push -u origin main
Option C: SSH Key Authentication (Password-Free)
Section titled “Option C: SSH Key Authentication (Password-Free)”
Terminal window
# 1. Generate SSH key
ssh-keygen -t ed25519 -C "your-email@example.com"
# 2. View public key
cat ~/.ssh/id_ed25519.pub
# 3. Add public key to Gitee: Settings → SSH Keys
# 4. Clone via SSH
git clone git@gitee.com:your-username/repo-name.git
# 5. Verify connection
ssh -T git@gitee.com

Q1: “remote: The project you were looking for could not be found.”

Section titled “Q1: “remote: The project you were looking for could not be found.””
  • Cause: Incorrect repository URL or no access
  • Fix: Verify the URL and check collaborator permissions
  • Cause: Expired PAT or incorrect password
  • Fix: Regenerate PAT and update stored credentials
  • Cause: Expired or corrupted Keychain entry
  • Fix: Open Keychain Access app → search gitee.com → delete the entry → reconfigure

Q4: Trae AI reports “not a git repository”

Section titled “Q4: Trae AI reports “not a git repository””
  • Cause: Working directory is not a Git repo
  • Fix: Run git init or clone an existing repository
SkillKey Operations
Gitee repository setupCreate account, create repo, get URL
Trae auto Git opsConfigure user.name/email, ensure credentials work
Remember credentialsUse osxkeychain or other credential helpers
Mac PAT authenticationGenerate token, store in Keychain, push without password
SSH password-free loginGenerate key, add to Gitee, clone via SSH

Building a commercial IoT product?

We provide ESP32 ODM design-to-manufacturing services. From prototype to production — the team behind this tutorial can build it with you.

Talk to us →