Este problema surge cuando el usuario olvida emitir el comando git push
después del comando git commit
. Cuando use git, por favor siempre asegúrese de los pasos básicos.
In an ideal cycle while working with git, always check the following git commands were used sequentially in the following order:
git pull
git add
git commit
git push
Personalmente evito mayoría de los temas publicados sobre git en la pila, porque siempre Flirteo con mis acitivites comando git a la secuencia anterior.
creé un acrónimo para asegurarse de que no se olvide, yo estoy hopoing lo mismo puede ser de utilidad para el lector que es:
pacp (read it as: pack push where (p=git push, a=git add, ck=git commit, push=git push).
Mi manera de memorizar el git push, agregar, comprometerse, pull es:
get pack push (meaning: git the pack and then push).
En resumen, recuerde "git" el paquete y luego "push".
La resolución de los problemas: me gustaría añadir mis comandos git recuperación más utilizados que son:
git checkout -- path/to/file/fileName.something #undo changes in file
The above undoes the changes in a file...similar can be applied for multiple files using * for file name, similarly can be applied to multiple directories separated by space.
git reset filename.txt
The above removes the file from stage...after this command we can safely do git commit and git will only commit those files we are in stage which means the file "filname.txt" won't get committed)
git pull origin your_intended_branch
Los cambios se fusionaron con lo último de your_intended_branch esto básicamente combina el cambio que cometiste pero no empujaste. Una vez que todo vaya bien, simplemente haga el push:
git push
O bien, el OP podría haber modificado su rama. – knittl
He oído que tirar es malo porque se fusionará de una manera que generalmente no deseas. Peronalmente, me gusta mantener mi historia lineal. ¿Cómo lo logro cuando me encuentro con el mismo error que el asker? –
intenté #git pull origen devops_branch_22112016 obteniendo error: sus cambios locales en los siguientes archivos se sobrescribirán por fusión: www/index.html Por favor, confirme sus cambios o destrúyalos antes de que pueda fusionar. Anulando –