2
respostas

envio de arquivo para github com falha

$ git push -u origin main To https://github.com/Rosanasantana84/Formulario-Cadastro-Dev ! [rejected] main -> main (non-fast-forward) error: failed to push some refs to 'https://github.com/Rosanasantana84/Formulario-Cadastro-Dev' 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.

hp@DESKTOP-SITT1EO MINGW64 ~/OneDrive/Área de Trabalho/formulário html (main) $

2 respostas

Boa noite, Rosana.

Este erro está acontecendo, porque os seus arquivos locais estão desatualizados em relação aos arquivos que estão no repositório do GitHub.

Tente fazer um 'git pull' e depois faça o 'git push' novamente.

eu tentei fazer um outro commit de outra pasta como teste e deu erro também.

hp@DESKTOP-SITT1EO MINGW64 ~/OneDrive/Área de Trabalho/Teste (main) $ git init Reinitialized existing Git repository in C:/Users/hp/OneDrive/Área de Trabalho/Teste/.git/

hp@DESKTOP-SITT1EO MINGW64 ~/OneDrive/Área de Trabalho/Teste (main) $ git status On branch main nothing to commit, working tree clean

hp@DESKTOP-SITT1EO MINGW64 ~/OneDrive/Área de Trabalho/Teste (main) $ git add .

hp@DESKTOP-SITT1EO MINGW64 ~/OneDrive/Área de Trabalho/Teste (main) $ git commit -m "teste" On branch main nothing to commit, working tree clean

hp@DESKTOP-SITT1EO MINGW64 ~/OneDrive/Área de Trabalho/Teste (main) $ git remote add origin main https://github.com/Rosanasantana84/teste2 usage: git remote add []

-f, --fetch           fetch the remote branches
--tags                import all tags and associated objects when fetching
                      or do not fetch any tag at all (--no-tags)
-t, --track <branch>  branch(es) to track
-m, --master <branch>
                      master branch
--mirror[=(push|fetch)]
                      set up remote as a mirror to push to or fetch from

hp@DESKTOP-SITT1EO MINGW64 ~/OneDrive/Área de Trabalho/Teste (main) $ git pull fatal: 'teste' does not appear to be a git repository fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

hp@DESKTOP-SITT1EO MINGW64 ~/OneDrive/Área de Trabalho/Teste (main) $