Solucionado (ver solução)
Solucionado
(ver solução)
3
respostas

enviando commit

Boa tarde, ao realizar o git push origin main ele da o erro PS C:\Users\willi\OneDrive\Área de Trabalho\3386-git-github-projeto_inicial (2)\3386-git-github-projeto_inicial> git push origin main To github.com:k9william/numero-secreto.git ! [rejected] main -> main (fetch first) error: failed to push some refs to 'github.com:k9william/numero-secreto.git' hint: Updates were rejected because the remote contains work that you do not hint: have locally. This is usually caused by another repository pushing to hint: the same ref. If you want to integrate the remote changes, use hint: 'git pull' before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

e tambem ao adicionar ou alterara algum arquivo, não esta aparecendo a sinalização ao lado do nome dos arquivos no VSCode. Insira aqui a descrição dessa imagem para ajudar na acessibilidade

3 respostas

Aparentemente tem algum arquivo no repositório remoto, que não tem no repositório local. Como por exemplo um arquivo readme.md. Testa executar 'git pull', e depois fazer o push novamente. Assim ele vai trazer os arquivos que você não tem localmente, e provavelmente deve permitir que você faça o push enviando as suas alterações.

Ola alexandre, eu dei o comando e mesmo assim não deu certo quando eu dei o "git push origin main" PS C:\Users\willi\OneDrive\Área de Trabalho\3386-git-github-projeto_inicial (2)\3386-git-github-projeto_inicial> git pull

remote: Enumerating objects: 14, done. remote: Counting objects: 100% (14/14), done. remote: Compressing objects: 100% (14/14), done. remote: Total 14 (delta 0), reused 14 (delta 0), pack-reused 0 Unpacking objects: 100% (14/14), 1.91 MiB | 1.61 MiB/s, done. From github.com:k9william/numero-secreto

  • [new branch] main -> origin/main 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

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> main

PS C:\Users\willi\OneDrive\Área de Trabalho\3386-git-github-projeto_inicial (2)\3386-git-github-projeto_inicial> git push origin main To github.com:k9william/numero-secreto.git ! [rejected] main -> main (non-fast-forward) error: failed to push some refs to 'github.com:k9william/numero-secreto.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. If you want to integrate the remote changes, hint: use 'git pull' before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. PS C:\Users\willi\OneDrive\Área de Trabalho\3386-git-github-projeto_inicial (2)\3386-git-github-projeto_inicial>

solução!

eu consegui resolver o erro dando o comando "git pull --rebase origin main"

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software