Por qué múltiples remotes
Los flujos reales suelen involucrar más de un remote: un origin para tu fork, un upstream para el repo canónico, además de mirrors, destinos de despliegue y forks por entorno.
Añadir remotes
git remote add origin [email protected]:you/fork.git
git remote add upstream https://github.com/org/repo.git
git remote add deploy [email protected]:app.git
git remote -v
Fetch desde todos
git fetch --all --prune
git remote update --prune
git fetch upstream main:main
Rastrear lo correcto
git branch --set-upstream-to=origin/main main
git push -u origin feature
git config branch.feature.remote origin
git config branch.feature.merge refs/heads/feature
URLs diferentes para push y pull
git remote set-url --push origin [email protected]:you/fork.git
git remote set-url origin https://github.com/you/fork.git
Mirroring
git remote add mirror --mirror=push [email protected]:org/repo.git
git push mirror
Flujo triangular
git config remote.pushDefault origin
git config push.default current
Credenciales por remote
[credential "https://github.com"]
helper = osxkeychain
[credential "https://gitlab.example.com"]
helper = !pass-git-helper
Errores comunes
Hacer push a upstream por error cuando querías origin; configura remote.pushDefault.