v1.31.0
conocimientogit-best-practiceschecklists/

repository-setup.md

Referencia que git-best-practices carga bajo demanda desde su SKILL.md.

git-best-practicesskill
checklistscarpeta
3095 Btamaño
2026-09-16último cambio del pack

Skill: git-best-practices

Checklist para configurar correctamente un repositorio Git nuevo.


1. Inicializacion

  • git init con --initial-branch=main
  • .gitignore apropiado para el stack (ver patterns/gitignore-patterns.md)
  • .gitattributes con line endings y LFS (ver patterns/gitattributes-config.md)
  • .editorconfig para consistencia entre editores
  • README.md con descripcion, setup, contribucion

2. Configuracion de Firmado

  • SSH signing configurado (ver patterns/ssh-signing.md)
  • commit.gpgsign = true (global o local)
  • tag.gpgsign = true
  • Clave publica registrada en GitHub/GitLab como "Signing Key"
  • allowed_signers configurado para verificacion local

3. Branch Protection (GitHub)

  • Branch main protegida
  • Require pull request antes de merge
  • Require al menos 1 aprobacion
  • Dismiss stale reviews al push nuevo
  • Require status checks (CI) antes de merge
  • Require branches up to date antes de merge
  • No permitir force push a main
  • No permitir delete de main
  • Preferir GitHub Rulesets sobre Branch Protection Rules legacy

GitHub Rulesets (Recomendado 2025+)

Repository Settings > Rules > Rulesets > New ruleset

Nombre: Proteccion Main
Target: main
Rules:
  [x] Restrict deletions
  [x] Require a pull request before merging
      - Required approvals: 1
      - Dismiss stale reviews
  [x] Require status checks to pass
      - build
      - test
  [x] Block force pushes
  [x] Require signed commits (opcional)

4. Templates

Todas salen de templates/ de esta skill: copiar, sustituir {{...}} y commitear.

  • .github/pull_request_template.md ← templates/pull_request_template.md.template
  • .github/ISSUE_TEMPLATE/{bug_report,feature_request,config}.yml ← templates/ISSUE_TEMPLATE/
  • .github/CODEOWNERS ← templates/CODEOWNERS.template (obligatorio si el ruleset lleva require_code_owner_review); validar con gh api repos/{org}/{repo}/codeowners/errors
  • .github/dependabot.yml ← templates/dependabot.yml.template
  • .github/rulesets/{branch-main,tags-release}.json ← templates/*-ruleset.json.template, aplicados con tools/github-rulesets.md

5. CI/CD

  • Workflow de build + test en PR
  • Workflow de deploy en merge a main (o manual)
  • Secretos en GitHub Secrets (no en codigo)
  • Branch-specific workflows con path filters

6. Git Hooks (Opcional)

  • commit-msg: Validar Conventional Commits
  • pre-commit: Build rapido o lint
  • pre-push: Tests
  • Usar Husky (Node) o scripts PS para instalacion automatica

7. Configuracion de Equipo

# Cada desarrollador debe ejecutar:
git config --global user.name "Nombre Apellido"
git config --global user.email "usuario@example.com"
git config --global init.defaultBranch main
git config --global pull.rebase true
git config --global fetch.prune true
git config --global diff.colorMoved zebra

Checklist 1.0.0

← Volver a la ficha de git-best-practices

Ovillo v1.31.0tag v1.31.0 (2026-10-06) · sin decisiones posteriores69 skills · 19 agents · 22 hooks · 3 reglas · 15 tools · 103 decisionesfuente: ovillo/.claude/skills/git-best-practices/checklists/repository-setup.mdCopyright 2026 Hugo Valer Rojas · Apache-2.0