-1

usei o comando > git push --set-upstream origin master e não deu pra enviar do meu repositório local pro meu repositório remoto, na tela apareceu o seguinte código:

$ git push --set-upstream origin master To https://github.com/Toni-emmanuel-git/teste.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/Toni-emmanuel-git/teste.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.

1
  • 1
    "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." Viu isso?
    – Woss
    20/05/2020 às 15:12

1 Resposta 1

1

Esta mensagem de erro diz que é necessário fazer um pull antes de fazer um push.

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

Esta mensagem diz:

dica: as atualizações (o comando git push) foram rejeitadas porque o seu repositório local está desatualizado em relação ao repositório remoto. (tradução livre)

Para resolver este problema, basta fazer um git pull origin <branch> para atualizar o seu repositório local. Lembrando que para saber branch de trabalho e deve-se utilizar o comando:

git branch

A branch de trabalho está marcada com (*), a saída deste comando será:

bugfix3

featureenvioemail

master

* testes

Após a operação acima ser realizada com sucesso, você deve fazer o push novamente.

$git push origin master
4
  • Entendi, mas em seguida apareceu outro erro. There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> master 20/05/2020 às 16:41
  • 1
    Você deve utilizar o comando completo. git pull origin master
    – Danizavtz
    20/05/2020 às 16:54
  • $ git pull origin master From github.com/T***-*******-git/teste * branch master -> FETCH_HEAD fatal: refusing to merge unrelated histories Outro erro 20/05/2020 às 17:35
  • 1
    Para resolver este problema é só rodar o comando: git pull origin master --allow-unrelated-histories
    – Danizavtz
    20/05/2020 às 17:59

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .