Git push falló, " Las actualizaciones de avance no rápido fueron rechazadas"


He editado mis repositorios GIT a través de Git Online. Después de intentar empujar mis cambios de código local, obtuve un error:

Git push failed, To prevent from losing history, non-fast forward updates were rejected.

¿Cómo puedo arreglar esto?

Author: Sarath, 2011-08-01

11 answers

Pull cambia primero:

git pull origin branch_name
 129
Author: iafonov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-07-02 08:03:05

Agregue force force a su línea de comandos si está seguro de que desea empujar. Por ejemplo, use git push origin --force (recomiendo la línea de comandos, ya que encontrará mucho más soporte de otros usuarios con la línea de comandos. Además, esto puede no ser posible con SmartGit.) Ver este sitio para más información: http://help.github.com/remotes/

 79
Author: Matt,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-11-16 16:24:41

Antes de empujar, haga un git pull con la opción rebase. Esto obtendrá los cambios que realizó en línea (en su origen) y los aplicará localmente, luego agregará sus cambios locales encima.

git pull --rebase

Ahora, puede empujar a control remoto

git push 

Para obtener más información, echa un vistazo a Git rebase explained y Capítulo 3.6 Git Branching - Rebasing.

 19
Author: satishgoda,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-07-02 08:03:34

Encontré el mismo error, simplemente agregue "force force" al comando, funciona

git push origin master --force
 10
Author: Wen Qi,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-10-10 10:21:11

He tenido el mismo problema.
La razón era, que mi sucursal local de alguna manera había perdido el seguimiento a la contraparte remota.

Después de

git branch branch_name --set-upstream-to=origin/branch_name
git pull

Y resolviendo los conflictos de fusión, pude empujar.

 4
Author: hardmooth,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-10-22 14:47:59

Puede agregar force force-with-lease al comando, funcionará.

git push --force-with-lease

--force es destructivo porque sobrescribe incondicionalmente el repositorio remoto con lo que tenga localmente. Pero force force-with-lease asegúrese de no sobrescribir el trabajo de otros.

Ver más información aquí.

 2
Author: igorjosesantos,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-07-20 17:22:53

(One) Solución para Netbeans 7.1: Prueba un pull. Esto probablemente también fallará. Ahora eche un vistazo a los registros (generalmente se muestran ahora en el IDE). Hay una / más línea diciendo:

"Error de extracción debido a este archivo:"

Busque ese archivo, elimínelo (haga una copia de seguridad antes). Normalmente es una .archivo gitignore, por lo que no eliminará el código. Vuelve a empujar. Todo debería funcionar bien ahora.

 1
Author: Sliq,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-08-07 11:41:22

He tenido el mismo problema. Resolví con

git checkout <name branch>
git pull origin <name branch>
git push origin <name branch>
 0
Author: Andrea Perdicchia,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-06-15 10:19:05

Esto es lo que funcionó para mí. Se puede encontrar en la documentación de git aquí

Si estás en tu rama deseada puedes hacer esto:

git fetch origin
# Fetches updates made to an online repository
git merge origin YOUR_BRANCH_NAME
# Merges updates made online with your local work
 0
Author: CodeChops,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-06-23 21:10:12

Encontró el mismo problema, para resolverlo, ejecute los siguientes comandos git.

  • git pull {url} --rebase
  • git push --set-upstream {url} master

Primero debes haber creado el repositorio en github.

 0
Author: blackFoxCoder,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-12-24 22:16:43

A veces, mientras tomas un tirón de tu git, la CABEZA se separa. Puede comprobar esto introduciendo el comando:

git branch 
  • (CABEZA separada de 8790704)

    Maestro

    Desarrollar

Es mejor moverse a su rama y tomar un nuevo tirón de su rama respectiva.

git checkout develop

git pull origin develop

git push origin develop
 0
Author: Abhinav,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-07-24 11:51:27