git push origin master出现问题

fgod 发布于 2016/09/08 23:37
阅读 1K+
收藏 0
$ git push origin master
To https://github.com/..../.  .git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/..../. .git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first 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上时最后一步push出现的问题。。求大神解答

加载中
0
ked
ked
先pull合并后,再commit,最后push
ked
ked
是的,先保证本地和远程同步,才能push
f
fgod
谢了,果然还是要pull 进行merge
f
fgod
这个是新建的一个空工程,也要先pull吗。我现在是把搭建的工程第一次push上去,前面已经执行了git add . ,git commit -am '' 了,然后再是git push操作
0
冷川
冷川

引用来自“ked”的评论

先pull合并后,再commit,最后push
0
f
fgod

引用来自“ked”的评论

先pull合并后,再commit,最后push
git pull origin master ,然后进入merge操作,输入merge的msg,保存退出,之后再执行git commit,git push就ok了
0
rwrqrwr
rwrqrwr
先git pull --rebase , 然后在git push
返回顶部
顶部