git push 错误

$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/g2k/cpp-demo.git'

或者在QT creator push 错误
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin master

命令'C:\Program Files (x86)\Git\bin\git.exe'终止,退出代码128。

解决方法:

echo "# cpp-demo" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/g2k/cpp-demo.git
git push -u origin master

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,414评论 0 23
  • 你怕别人说你贼吗?或者怕不怕孔子说的那句话:老而不死是为贼。 我很怕修为不够的人偏偏有老骥伏枥之心,非要张罗,不尴...
    2085阅读 1,527评论 0 0
  • 一到假期,就是慵懒时间。 不想做早餐,于是街上觅食。 此店只专注两样美食,呵呵, 来一碗面线糊就好, 老板,加海蛎...
    萧书忆阅读 2,540评论 0 0
  • 01 认识一对夫妻,五十多岁的年纪,还将生活过得如同初恋一般。 生活的大小事情两人都会商量,总是会得到一个双方满意...
    大头针思维阅读 3,085评论 0 3