Git / GitHub version control & código
gitgithubmerge
🧭 Commits & Branches
| Status atual | git status |
| Adicionar todos | git add . |
| Commit rápido | git commit -m "mensagem" |
| Listar branches | git branch --all |
| Nova branch | git checkout -b feature/x |
| Voltar para main | git checkout main |
| Mesclar branch | git merge feature/x |
| Rebase em main | git rebase main |
🌐 Remotes & Pull Requests
| Adicionar remote | git remote add origin git@github.com:USER/REPO.git |
| Enviar branch | git push -u origin main |
| Puxar atualizações | git pull origin main |
| Buscar tudo | git fetch --all |
| Clonar repositório | git clone git@github.com:USER/REPO.git |
| Remotes remotos | git branch -r |
| Deletar branch remota | git push origin --delete feature/x |
⚠️ GitHub / Fixes
| Reset suave | git reset --soft HEAD~1 |
| Reset completo | git reset --hard HEAD~1 |
| Remover do stage | git restore --staged arquivo.txt |
| Descartar alterações | git checkout -- arquivo.txt |
| Ver histórico compacto | git log --oneline --graph --all |
| Guardar alterações | git stash push -m "work-in-progress" |
| Restaurar stash | git stash pop |