feat: publish safe Gitea repository update skill

This commit is contained in:
2026-09-02 12:08:58 +08:00
commit 72c856975e
6 changed files with 257 additions and 0 deletions
@@ -0,0 +1,55 @@
# Windows GCM Setup
Use this reference on native Windows or Windows Subsystem for Linux (WSL).
## Native Windows
In PowerShell, verify Git, GCM, and the configured helper:
```powershell
git --version
git credential-manager --version
Get-Command git-credential-manager -ErrorAction SilentlyContinue
git config --show-origin --get-all credential.helper
```
Git for Windows is the preferred GCM installation method and includes GCM by default. If GCM is missing or broken, repair or reinstall the current Git for Windows release and keep Git Credential Manager selected. The official standalone GCM user installer is an alternative that does not require administrator rights; the system installer does.
If either version command succeeds, reuse the installed GCM. Do not reinstall Git for Windows, install standalone GCM, or upgrade GCM as part of an ordinary repository update.
After installation, start a new PowerShell session and run:
```powershell
git-credential-manager --version
git-credential-manager configure
git config --global --get-all credential.helper
```
GCM uses Windows Credential Manager by default. If `credential.helper=store` is active, stop before entering a PAT and replace the plaintext helper through GCM configuration. Never edit `%USERPROFILE%\.git-credentials` to add a PAT.
## WSL
Prefer Git for Windows plus its GCM executable. Inside WSL, configure the helper using the actual installed path, commonly:
```bash
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"
```
A current-user standalone installer may instead place GCM under the user's `AppData/Local/Programs` directory. Inspect the real location rather than guessing it. GCM backed by Windows Credential Manager requires an interactive Windows desktop session and does not persist credentials from a remote SSH-only Windows session.
## Authentication and Verification
At the first `git ls-remote`, clone, fetch, or push prompt:
- Username: the Gitea login name or email accepted by the instance.
- Password: the PAT with `write:repository`, entered locally.
Confirm the remote URL contains no credentials:
```powershell
git remote -v
```
Do not disable TLS verification for internal certificates. Install the organization's trusted CA correctly or stop and report the certificate issue.
Official references: [GCM installation](https://github.com/git-ecosystem/git-credential-manager/blob/main/docs/install.md), [Windows credential store](https://github.com/git-ecosystem/git-credential-manager/blob/main/docs/credstores.md), and [WSL configuration](https://github.com/git-ecosystem/git-credential-manager/blob/main/docs/wsl.md).