我在本地建了一个文件夹,文件夹放入一个文档。然后具体步骤如上图,先设置ssh-key,然后按照一般步骤git init ,git add . ,git commit -m 'dd',git remote add origin,git pull origin master,git push oritin master,尝试了好几次不同的步骤和方法都不行,没有上传代码成功。我用的https的github地址。也试过git push --upstream这个也不行
报错:
failed to push some refs to 'https://github.com/gipal/dd.git'
Updates were rejected because the tip of your current branch is behind
its remote counterpart. Integrate the remote changes (e.g.
'git pull ...') before pushing again.
See the 'Note about fast-forwards' in 'git push --help' for details.
试了git pull也不行,麻烦大神帮忙解决,感激不尽
执行git push origin master报错error: failed to push some refs to...
解决办法:大部分是由于github中的README.md文件不在本地代码目录中导致的, 先通过git pull --rebase origin master进行合并,再通过git push -u origin master上传