Home  >  Q&A  >  body text

git push -u origin master error report

There is a project locally. I first git init to initialize the library, and then git add.
git commit -m"test"
Configuration association
git remote add origin git@github.com:myName/test .git

Execution Upload to the good library I have created on github,
The command reports an error, failed to push some refs to git@github.com:myName/test.git

After Baidu, it said that I need to bring the README.md file. I created this file locally, but still get an error?
What’s your reason?

After using git pull --rebase origin master, many characters will be inserted into the code. . . . .

How do you deal with this problem? . .

Execute git pull origin master

PHPzPHPz2670 days ago1393

reply all(3)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-31 10:37:46

    Reason

    1. The server warehouse is not clean when it is created, so you need to drag it down from the server first

    Solution

    1.

    $git pull origin master
    //你自己建了readme可能会要求你merge
    $git push origin master

    //If you built the readme yourself, you may be asked to merge it, please merge it manually

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-31 10:37:46

    It means that the branch you submitted is still behind the online branch, which means that the local and online versions are not unified
    Let me tell you the solution
    Don’t git init
    You should first git clonethe remote warehouse
    and then Perform the following operations.

    reply
    0
  • 迷茫

    迷茫2017-05-31 10:37:46

    The answer has been given in the prompt,

    git pull
    git add -A
    git commit -m '合并冲突'
    git push

    reply
    0
  • Cancelreply