-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit-git-trae..sh
More file actions
executable file
·174 lines (145 loc) · 4.57 KB
/
init-git-trae..sh
File metadata and controls
executable file
·174 lines (145 loc) · 4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/bin/bash
# Script per inizializzare Git repository per TRAE-RULES-PROJECT
# Da eseguire dentro /Users/tony/Documents/REPOGITH/TRAE-RULES-PROJECT
# bash# Prima esegui setup_repo.sh per creare la struttura
# ./setup_repo.sh
# # Poi spostati nella nuova repo
# cd /Users/tony/Documents/REPOGITH/TRAE-RULES-PROJECT
# # Copia lo script init-git-trae.sh lì dentro
# # (oppure crealo direttamente copiando dall'artifact)
# # Rendilo eseguibile
# chmod +x init-git-trae.sh
# # Eseguilo
# ./init-git-trae.sh
set -e
echo "🚀 Inizializzazione Git per TRAE-RULES-PROJECT"
echo ""
# Colori
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Verifica di essere nella directory corretta
EXPECTED_DIR="/Users/tony/Documents/REPOGITH/TRAE-RULES-PROJECT"
if [ "$PWD" != "$EXPECTED_DIR" ]; then
echo -e "${YELLOW}⚠️ Devi eseguire questo script da: ${EXPECTED_DIR}${NC}"
echo -e "${YELLOW} Directory corrente: ${PWD}${NC}"
exit 1
fi
# Verifica se .git esiste
if [ -d ".git" ]; then
echo -e "${YELLOW}⚠️ Git già inizializzato in questa cartella${NC}"
read -p "Vuoi ricominciare da zero? (y/n): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf .git
echo -e "${GREEN}✓ .git rimosso${NC}"
else
echo "Operazione annullata"
exit 1
fi
fi
# Inizializza Git
echo -e "${BLUE}📁 Inizializzazione repository Git...${NC}"
git init
git branch -M main
echo -e "${GREEN}✓ Git inizializzato${NC}"
# Verifica .gitignore (dovrebbe già esistere dallo script setup_repo.sh)
if [ ! -f ".gitignore" ]; then
echo -e "${YELLOW}⚠️ .gitignore mancante, lo creo ora...${NC}"
cat > .gitignore << 'EOF'
.# Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
.npm
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
venv/
ENV/
build/
dist/
*.egg-info/
# Conda
.conda/
*.tar.bz2
# IDEs
.vscode/
.idea/
*.swp
.DS_Store
# Logs
*.log
logs/
# Temporary files
*.tmp
.cache/
# Results (optional)
benchmark_results_*.csv
benchmark_results_*.txt
benchmark_charts_*.txt
# Environment
.env
.env.local
# Setup scripts (local only)
init-git-repo.sh
EOF
echo -e "${GREEN}✓ .gitignore creato${NC}"
fi
# Aggiungi file al staging
echo -e "${BLUE}📦 Aggiunta file...${NC}"
git add .
# Primo commit
echo -e "${BLUE}💾 Primo commit...${NC}"
git commit -m "Initial commit: TRAE Workflow System
- Complete continuity system for TRAE IDE
- Multi-session workflow with SAVEAGG/LOADAGG & other commands
- Project documentation and examples
- Bilingual support (IT/EN)
- Ready-to-use package structure"
echo ""
echo -e "${GREEN}✅ Repository Git locale pronta!${NC}"
echo ""
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${YELLOW}📋 PROSSIMI PASSI (3 opzioni):${NC}"
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
echo -e "${GREEN}OPZIONE 1 - Usa VSCode (CONSIGLIATA):${NC}"
echo " 1. Apri la palette (Cmd/Ctrl + Shift + P)"
echo " 2. Cerca: 'Git: Add Remote'"
echo " 3. Incolla: https://github.com/AntonioDEM/trae-rules-project.git"
echo " 4. Clicca su 'Publish Branch' nella barra Git"
echo " 5. ✅ Fatto!"
echo ""
echo -e "${YELLOW}OPZIONE 2 - Crea la repo su GitHub manualmente:${NC}"
echo " 1. Vai su: https://github.com/new"
echo " 2. Nome repository: trae-rules-project"
echo " 3. Descrizione: Complete workflow continuity system for TRAE IDE with multi-session support"
echo " 4. Scegli 'Public'"
echo " 5. NON inizializzare con README (hai già i file)"
echo " 6. Clicca 'Create repository'"
echo " 7. Poi nel terminale esegui:"
echo ""
echo " git remote add origin https://github.com/AntonioDEM/trae-rules-project.git"
echo " git push -u origin main"
echo ""
echo -e "${BLUE}OPZIONE 3 - Usa GitHub CLI (richiede installazione):${NC}"
echo " brew install gh # Su macOS"
echo " gh auth login # Autenticazione via browser (sicura)"
echo " gh repo create trae-rules-project --public --source=. --push"
echo ""
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
echo -e "${YELLOW}📌 DOPO IL PUSH, aggiungi questi topic su GitHub:${NC}"
echo " ai-assistant, trae-ide, workflow, productivity"
echo " developer-tools, automation, documentation"
echo " ai-coding, project-management, continuity"
echo ""
echo -e "${GREEN}🎉 Buon lavoro!${NC}"