From f3779a801a8eee73c16c6754a8f3f5afe95b27d7 Mon Sep 17 00:00:00 2001 From: StillHammer Date: Tue, 30 Dec 2025 11:00:42 +0700 Subject: [PATCH] Add Gitea guide for Claude agents --- docs/GITEA_GUIDE.md | 217 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 docs/GITEA_GUIDE.md diff --git a/docs/GITEA_GUIDE.md b/docs/GITEA_GUIDE.md new file mode 100644 index 0000000..1c8534d --- /dev/null +++ b/docs/GITEA_GUIDE.md @@ -0,0 +1,217 @@ +# Guide Gitea pour Claude + +## Credentials + +**Toujours lire en premier:** +``` +C:\Users\alexi\Documents\projects\ProjectTracker\.env +``` + +Contient: +- `GITEA_URL` - URL du serveur Gitea +- `GITEA_TOKEN` - Token d'authentification API + +## Creer un nouveau repo + +### 1. Creer le repo sur Gitea via API + +```bash +curl -X POST "https://git.etheryale.com/api/v1/user/repos" \ + -H "Authorization: token " \ + -H "Content-Type: application/json" \ + -d "{\"name\": \"\", \"description\": \"\", \"private\": false}" +``` + +**Reponse:** JSON avec `clone_url` et `html_url` + +### 2. Initialiser git localement + +```bash +cd "" +git init +``` + +### 3. Creer .gitignore adapte au projet + +Exemple pour projet Access/VBA: +``` +# Access lock files +*.laccdb +*.ldb + +# Backups +.vba_backups/ +*.bak + +# Windows +Thumbs.db +Desktop.ini +nul +con +prn +aux + +# Temp +*.tmp +~$* +``` + +### 4. Ajouter les fichiers + +**Important:** Ne pas utiliser `git add .` si fichier `nul` existe (erreur Windows). + +Ajouter fichiers specifiquement: +```bash +git add .gitignore README.md +git add / +git status +``` + +### 5. Premier commit + +```bash +git commit -m "$(cat <<'EOF' +Initial commit - + + + +🤖 Generated with [Claude Code](https://claude.com/claude-code) + +Co-Authored-By: Claude Opus 4.5 +EOF +)" +``` + +### 6. Configurer remote et push + +```bash +git branch -M main +git remote add origin https://git.etheryale.com/StillHammer/.git +git push -u origin main +``` + +--- + +## Operations courantes + +### Commit et push + +```bash +git add +git commit -m "Description du changement" +git push +``` + +### Voir le status + +```bash +git status +git log --oneline -5 +``` + +### Creer une branche + +```bash +git checkout -b feature/ma-fonctionnalite +git push -u origin feature/ma-fonctionnalite +``` + +--- + +## API Gitea - Endpoints utiles + +Base URL: `https://git.etheryale.com/api/v1` + +| Action | Methode | Endpoint | +|--------|---------|----------| +| Lister mes repos | GET | `/user/repos` | +| Creer repo | POST | `/user/repos` | +| Info repo | GET | `/repos/StillHammer/` | +| Supprimer repo | DELETE | `/repos/StillHammer/` | +| Lister branches | GET | `/repos/StillHammer//branches` | +| Lister issues | GET | `/repos/StillHammer//issues` | +| Creer issue | POST | `/repos/StillHammer//issues` | + +### Exemple: Lister mes repos + +```bash +curl -H "Authorization: token " \ + "https://git.etheryale.com/api/v1/user/repos" | jq '.[].name' +``` + +--- + +## Troubleshooting + +### Erreur "nul" ou fichier reserve Windows + +Ajouter au .gitignore: +``` +nul +con +prn +aux +``` + +Et ajouter fichiers specifiquement au lieu de `git add .` + +### Erreur proxy/connexion + +Le fichier .env mentionne: +> Use wget instead of curl for API calls due to proxy compatibility + +Si curl echoue, essayer wget: +```bash +wget --header="Authorization: token " \ + --header="Content-Type: application/json" \ + --post-data='{"name":"repo"}' \ + -qO- "https://git.etheryale.com/api/v1/user/repos" +``` + +### Authentification git push + +Si demande credentials, utiliser: +- Username: `StillHammer` +- Password: `` + +Ou configurer credential helper: +```bash +git config credential.helper store +``` + +--- + +## Template .gitignore par type de projet + +### Python +``` +__pycache__/ +*.pyc +*.pyo +.venv/ +venv/ +*.egg-info/ +dist/ +build/ +``` + +### Node.js +``` +node_modules/ +npm-debug.log +.env +dist/ +``` + +### Access/VBA +``` +*.laccdb +*.ldb +.vba_backups/ +~$* +``` + +--- + +**Auteur:** Claude +**Date:** 2025-12-30