21 - Estás a trabalhar no ramo local master
, e tens alguns commits feitos
desde a última vez que sincronizaste com o remoto origin
. Ao fazeres push
das tuas alterações, obténs a seguinte mensagem:
error: failed to push some refs to 'https://gitlab.com/ulht/projeto.git'
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: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Explica qual é o problema e como o podes resolver, assumindo que não existem merge conflicts.
O problema é que as alterações atuais foram rejeitadas, pois já tinham sido
feitas alterações ao repositório remoto origin
desde a última vez que se
sincronizou o ramo local master
com o remoto.
Este problema pode ser resolvido, assumindo que não existem
merge conflicts, usando os seguintes comandos:
git fetch origin
git merge origin/master
$ git push origin master
Por Diana Nóia