I wanted to send two files from my folder to my remote repository on github and it went wrong after I logged in. What to do?

Asked

Viewed 137 times

-1

I used the command > git push --set-upstream origin master and could not send from my local repository to my remote repository, on the screen appeared the following code:

$ 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

    "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." You saw that?

1 answer

1

This error message says you need to pull before pushing.

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

This message says:

tip: updates (the command git push) were rejected because the your local repository is outdated from the repository remote. (free translation)

To solve this problem, just make a git pull origin <branch> to update your local repository. Remembering that to know branch work and should use the command:

git branch

The working branch is marked with (*), the output of this command will be:

bugfix3

featureenvioemail

master

* testing

After the above operation is successfully performed, you should push again.

$git push origin master
  • I understood, but then another error appeared. 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

  • 1

    You must use the full command. git pull origin master

  • $ git pull origin master From https://github.com/T*******-git/test * branch master -> FETCH_HEAD fatal: refusing to merge unrelated histories Other error

  • 1

    To solve this problem just run the command: git pull origin master --allow-unrelated-histories

Browser other questions tagged

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