Files
NoIdle/GIT_INSTRUCTIONS.md
Sérgio Corrêa 4fab8593ac refactor: Migração completa de PointControl para NoIdle
- Pasta renomeada: /var/www/pointcontrol → /var/www/noidle
- PM2 renomeado: pointcontrol-api → noidle-api
- Package.json backend atualizado
- Package.json frontend atualizado
- Todas as referências de código atualizadas
- Documentação atualizada
- Script de migração executado com sucesso
- Backup criado em /tmp/
- Sistema testado e funcionando

Resolução: Organização completa da estrutura bagunçada
2025-11-16 23:38:59 +00:00

323 lines
5.9 KiB
Markdown

# 📚 Instruções Git - NoIdle
## ✅ Repositório Configurado com Sucesso!
Seu projeto NoIdle foi enviado para:
**https://meurepositorio.com/sergio.correa/NoIdle.git**
---
## 📊 Status Atual
**Commit inicial enviado:**
- Commit: `6086c13`
- Mensagem: "feat: Implementação completa do NoIdle - Cliente, Backend e Scripts"
- Branch: `main`
- Arquivos: 58 arquivos (10.693+ linhas)
---
## 🔄 Comandos Git Úteis
### Ver Status
```bash
cd /var/www/noidle
git status
```
### Ver Histórico
```bash
git log --oneline
```
### Fazer Novos Commits
```bash
# Adicionar arquivos modificados
git add .
# Fazer commit
git commit -m "Sua mensagem aqui"
# Enviar para o repositório
git push
```
### Criar Nova Branch
```bash
# Criar e mudar para nova branch
git checkout -b feature/nova-funcionalidade
# Fazer push da nova branch
git push -u origin feature/nova-funcionalidade
```
### Atualizar do Repositório Remoto
```bash
# Baixar atualizações
git pull origin main
```
### Ver Branches
```bash
# Listar branches locais
git branch
# Listar branches remotas
git branch -r
# Listar todas
git branch -a
```
---
## 🌐 Acessar Repositório Web
Abra no navegador:
**https://meurepositorio.com/sergio.correa/NoIdle**
---
## 📦 Estrutura do Repositório
```
NoIdle/
├── README.md # Documentação principal
├── LEIA_PRIMEIRO.md # Guia rápido
├── CLIENTE_CORRIGIDO.py # Cliente Windows (Python)
├── BUILD_NOIDLE.ps1 # Build Windows
├── BUILD_LINUX.sh # Build Linux
├── BUILD_CLIENTE.md # Documentação de build
├── COMANDOS_BUILD.md # Quick reference
├── Dockerfile.build # Docker build
├── CONFIGURAR_AUTOSTART_NOIDLE.ps1 # Script de configuração
├── VERIFICAR_E_CORRIGIR_NOIDLE.ps1 # Script de diagnóstico
├── DIAGNOSTICO_CLIENTE_WINDOWS.ps1 # Diagnóstico detalhado
├── SOLUCAO_AUTOSTART.md # Documentação técnica
├── GUIA_RAPIDO_AUTOSTART.md # Guia do usuário
├── README_SOLUCAO_AUTOSTART.md # Visão geral da solução
├── backend/ # API Node.js
│ ├── server.js
│ ├── routes/
│ └── config/
└── frontend/ # Dashboard Next.js
└── ...
```
---
## 🚀 Próximos Passos
### 1. Clone em Outra Máquina
```bash
git clone https://meurepositorio.com/sergio.correa/NoIdle.git
cd NoIdle
```
### 2. Build no Windows
```powershell
# Clonar repositório
git clone https://meurepositorio.com/sergio.correa/NoIdle.git
cd NoIdle
# Build
.\BUILD_NOIDLE.ps1
```
### 3. Desenvolver Localmente
```bash
# Backend
cd backend
npm install
npm run dev
# Frontend
cd frontend
npm install
npm run dev
```
---
## 🔐 Segurança
### ⚠️ Token no Remote URL
O token de acesso está na URL do remote. Para maior segurança:
**Opção 1: Remover token da URL após configurar SSH**
```bash
# Configurar SSH
ssh-keygen -t ed25519 -C "sergio.correa@meurepositorio.com"
cat ~/.ssh/id_ed25519.pub
# Adicionar chave pública no Gitea
# Mudar para SSH
git remote set-url origin git@meurepositorio.com:sergio.correa/NoIdle.git
```
**Opção 2: Usar Git Credential Helper**
```bash
# Cache de credenciais (1 hora)
git config --global credential.helper cache
# Ou armazenar permanentemente (menos seguro)
git config --global credential.helper store
```
---
## 📝 Boas Práticas
### Mensagens de Commit
```bash
# Formato recomendado
feat: Nova funcionalidade
fix: Correção de bug
docs: Atualização de documentação
refactor: Refatoração de código
test: Adição de testes
chore: Tarefas de manutenção
# Exemplos
git commit -m "feat: Adiciona suporte a proxy HTTP"
git commit -m "fix: Corrige problema de auto-start no Windows 11"
git commit -m "docs: Atualiza README com instruções de instalação"
```
### Workflow Recomendado
```bash
# 1. Criar branch para nova feature
git checkout -b feature/minha-feature
# 2. Fazer alterações e commitar
git add .
git commit -m "feat: Implementa minha feature"
# 3. Push da branch
git push -u origin feature/minha-feature
# 4. Criar Pull Request no Gitea
# 5. Após aprovação, merge para main
```
---
## 🔄 Atualizar Repositório
Sempre que fizer alterações:
```bash
cd /var/www/noidle
# Ver o que mudou
git status
# Adicionar arquivos
git add .
# Commitar
git commit -m "Sua mensagem aqui"
# Enviar
git push
```
---
## 📊 Ver Diferenças
```bash
# Ver mudanças não commitadas
git diff
# Ver mudanças já em staging
git diff --staged
# Ver mudanças entre branches
git diff main..outra-branch
```
---
## 🏷️ Tags (Versões)
```bash
# Criar tag
git tag -a v1.0.0 -m "Versão 1.0.0 - Release inicial"
# Enviar tags
git push --tags
# Listar tags
git tag
```
---
## 🆘 Comandos de Emergência
### Desfazer Último Commit (mantém alterações)
```bash
git reset --soft HEAD~1
```
### Desfazer Alterações Locais
```bash
git checkout -- arquivo.txt
```
### Voltar para Commit Específico
```bash
git checkout <hash-do-commit>
```
### Limpar Arquivos Não Rastreados
```bash
git clean -fd
```
---
## 📞 Ajuda
### Documentação Git
```bash
git help
git help commit
git help push
```
### Links Úteis
- Repositório: https://meurepositorio.com/sergio.correa/NoIdle
- Gitea Docs: https://docs.gitea.io/
---
## ✅ Checklist Pós-Setup
- [x] Repositório inicializado
- [x] Arquivos commitados
- [x] Remote configurado
- [x] Push realizado com sucesso
- [x] Git user configurado
- [ ] SSH configurado (opcional)
- [ ] Colaboradores adicionados (se necessário)
- [ ] Proteção de branch configurada (se necessário)
---
**Repositório pronto para uso! 🎉**
Para começar a trabalhar em outro lugar:
```bash
git clone https://meurepositorio.com/sergio.correa/NoIdle.git
```