1
resposta

Erro ao fazer o push

Estou tentando fazer um push do git para o github, mas aparece a seguinte frase:

! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/LucasToisso/CanvasHTML.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Já tive esse projeto com o push na minha máquina, mas tirei, talvez esse possa ser o erro

1 resposta

Oi Lucas

Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes

Essa mensagem significa que houve mudanças no branch remoto que você não tem localmente. E o Git diz a você para fazer o pull dessas novas alterações e fundi-las com o seu código local para em seguida fazer o push novamente.

Você vai precisar fazer o git pull para sincronizar as alterações do repositório remoto antes de conseguir fazer o push. Você também pode fazer o git push -f, mas nesse caso você está forçando o repositório remoto a ficar igual o seu local (vai perder as alterações do remoto que você não tem localmente pois vai sobreescrever).