Git Pie: A Arte Ancestral do Versionamento 🥧 Help

Migrando de SVN para Git

Processo de Migração

Preparação

# Instalar git-svn apt-get install git-svn # Listar autores SVN svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors.txt

Migração Básica

# Clonar repositório SVN git svn clone --stdlayout --authors-file=authors.txt \ http://svn.example.com/repo/ git_repo # Otimizar repositório cd git_repo git gc --aggressive

Desafios Comuns

Problemas e Soluções

DesafiosBranchesHistóriaUsuáriosSVN tagsSVN externalsBranch trackingCommits grandesBináriosMergesMapeamentoPermissõesWorkflows

Validação

Checklist

Verificar

Testar

Validar

Confirmar

Commits

Integridade

Funcionalidade

Permissões

Workflows

Scripts Úteis

Mapeamento de Usuários

#!/bin/bash # Gerar mapeamento de usuários svn log -q | \ awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2}' | \ sort -u > svn_users.txt # Criar arquivo de autores while read user; do echo "$user = $user <$user@example.com>" done < svn_users.txt > authors.txt

Migração com Branches

#!/bin/bash # Migrar com branches e tags git svn clone \ --stdlayout \ --authors-file=authors.txt \ --no-metadata \ --prefix="svn/" \ http://svn.example.com/repo/ \ git_repo

Pós-Migração

Configuração Git

# Configurar remotes git remote add origin git@github.com:org/repo.git git push -u origin --all git push origin --tags # Limpar referências SVN git config --remove-section svn-remote.svn rm -rf .git/svn

Melhores Práticas

Recomendações

PráticasPlanejamentoExecuçãoSuporteBackupTimelineComunicaçãoTestesValidaçãoDocumentaçãoTreinamentoMonitoramentoRollback
22 abril 2025