Aún estoy aprendiendo GIT. Intenté sincronizar mis repos locales con la confirmación hecha en los repos remotos de estilo 'repos central'. El primer paso fue search el origen:
git fetch origin remote: Counting objects: 1, done. remote: Total 1 (delta 0), reused 1 (delta 0) Unpacking objects: 100% (1/1), done. From ssh://github.com/XXXXXX/ZZZZZZZZ bc2afff..3b3c8ee master -> origin/master
Luego se verifica estado y twig.
git status # On branch master # Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded. # nothing to commit (working directory clean) git br * master
Luego intenté –ff-only.
git merge --ff-only origin master fatal: Not possible to fast-forward, aborting.
Ok, haz una fusión no-ff:
git merge origin master Fast-forwarding to: origin Already up-to-date with master Merge made by the 'octopus' strategy.
Comprobado el compromiso:
git show 4cbd3 ...snip... Merge branch 'master', remote-tracking branch 'origin'
Parece que se realizó una fusión no-ff. La salida de la fusión 'Avance rápido hacia: origen' es lo que es confuso: ¿qué está tratando de decirme? ¿Qué me estoy perdiendo? ¡Gracias!
A diferencia de, por ejemplo, git push
, git merge
no toma el nombre de un control remoto como argumento, por lo que cuando dices git merge origin master
realmente dices "hacer una fusión de pulpo desde las twigs 'origen' y 'maestro'". Lo que deberías haber corrido es esto:
git merge origin/master
Aparentemente tienes una twig llamada "origen". ¿Debería estar allí, o lo creó por error?
No estoy seguro de por qué obtienes un comportamiento incoherente entre git merge --ff-only origin master
git merge origin master
y git merge --ff-only origin master
, pero eso realmente no importa.