1,在使用对源代码进行push到:
To http://ip:8081/yw/testweb.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'http://ip:8081/yw/testweb.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
出现错误的主要原因是github中的README.md文件不在本地代码目录中
2,git pull --rebase origin master
执行上面代码后可以看到本地代码库中多了README.md文件
3,此时再执行语句 git push -u origin master即可完成代码上传到github