Git Push repository problem (with other people)

Asked

Viewed 133 times

-1

Briefly, I’ve tried to give git push, git pull, accept the changes, I’ve given commit, git push --set-upstream origin main, git push -u origin main.

Error below if you cannot open the image:

! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/BrenoPierin/Edux_ReactNative.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.

Erro que está dando

  • 1

    Use git pull origin main

2 answers

1

The error is self-explanatory:

"Updates were rejected because your current branch is behind your remote counterpart. Integrate remote changes (for example, git pull ...) before pushing again."

Like you are in Brach main use git pull origin main, this will update your local repository. Then you will be able to run git push -u origin main

0

First of all you should commit your changes with the following commands:

git add .
git commit -m "mensagem"

And then use the command:

git pull origin main

If you are using vs code, the changes will appear in the code for you to accept.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.