这是一个坑
你要知道作为一个新手对git的使用还处于摸索状态
今天就将这样的坑分享给大家
昨天,接到任务将代码发到远程仓库里。于是,我就天真的按步骤提交了!
然后就:
To https:
! [rejected] z -> z (non-fast-forward)
error: failed to push some refs to ‘https:
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
放心你要是第一次提交是不可能解决问题的!!!!!
怎么办??
这个时候,你要指定仓库才能成功: