Mi amigo y yo habíamos hecho cambios en la misma twig, él insistió y después de algún time traté de hacer lo mismo, pero lo conseguí. pero recibí el error diciendo:
error: failed to push some refs to '<repo_name>' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (eg, 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Así que hice un tirón desde la sucursal remota y resolví conflictos de fusión.
Pero después de eso cuando traté de presionar al control remoto habiendo incluido cambios tanto de mi amigo como de mí, dijo:
Everything up-to-date
pero mis cambios aún no se reflejan en el repository remoto. Que me estoy perdiendo aqui ?
Su local branch
está detrás de remote branch
. Por lo tanto, al principio tire de los cambios del control remoto y luego presione sus cambios.
$ git fetch $ git pull origin <branch-name> $ git push origin HEAD
O bien, puedes usar rebase
. Esto requiere todas las confirmaciones remotas y luego coloca tus commits en la top in git log
.
$ git pull --rebase $ git push origin HEAD # push your local commit(s)
Al igual que las otras respuestas, puede que tenga que especificar la reference remota directamente, ya que parece que su twig de seguimiento no debe configurarse para presionar a la reference remota correcta.
Por ejemplo, git push origin <branchName>
.
Puede sacar los cambios de sus amigos de la sucursal usando
git pull origin <branchName>
resolver conflictos si los hay y luego intentar
git push origin <branchName>