git push -u origin master
项目推送时遇Git推送错误:
To gitee.com:jialewang-code/html5_learn.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitee.com:jialewang-code/html5_learn.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.
这个问题的产生是因为远程仓库与本地仓库并不一致所造成。
通过以下命令远程库同步到本地库:
git pull --rebase origin master
执行上面代码后可以看到本地代码库中多了README.md文件
此时再执行语句即可
git push -u origin master