git--src refspec master does not match any.错误解决

错误日志

PS D:\gitporjects\vuecabulary> git init
Initialized empty Git repository in D:/gitporjects/vuecabulary/.git/
PS D:\gitporjects\vuecabulary> git remote add origin https://gitee.com/*/*-origin.git
PS D:\gitporjects\vuecabulary> git push -u origin "master"
error: src refspec master does not match any
error: failed to push some refs to 'https://gitee.com/*/*-origin.git'
PS D:\gitporjects\vuecabulary> git pull origin master
fatal: couldnt find remote ref master
PS D:\gitporjects\vuecabulary-master> git add .
warning: LF will be replaced by CRLF in .editorconfig.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in LICENSE.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in babel.config.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in public/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/App.vue.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/api/cache.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/api/word.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/components/Header.vue.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/components/Login.vue.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/global/router.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/global/store.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/main.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/pages/Home.vue.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/pages/Learn.vue.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/pages/Revise.vue.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/static/words/List1.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/static/words/List2.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/static/words/List3.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/static/words/List4.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/static/words/List5.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/static/words/List6.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/utils/event.js.
The file will have its original line endings in your working directory
PS D:\gitporjects\vuecabulary> git commit -m update:第一此提交代码
[master (root-commit) 570a05b] update:第一此提交代码
 34 files changed, 22350 insertions(+)
 create mode 100644 .editorconfig
 create mode 100644 .gitignore
 create mode 100644 LICENSE
 create mode 100644 README.md
 create mode 100644 babel.config.js
 create mode 100644 package-lock.json
 create mode 100644 package.json
 create mode 100644 public/favicon.ico
 create mode 100644 public/index.html
 create mode 100644 src/App.vue
 create mode 100644 src/api/cache.js
 create mode 100644 src/static/words/List2.json
 create mode 100644 src/static/words/List3.json
 create mode 100644 src/static/words/List4.json
 create mode 100644 src/static/words/List5.json
 create mode 100644 src/static/words/List6.json
 create mode 100644 src/utils/event.js
PS D:\gitporjects\vuecabulary> git push -u origin "master"
Enumerating objects: 46, done.
Counting objects: 100% (46/46), done.
Delta compression using up to 12 threads
Compressing objects: 100% (45/45), done.
Writing objects: 100% (46/46), 298.50 KiB | 7.65 MiB/s, done.
Total 46 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.3]
To https://gitee.com/*/*-origin.git
 * [new branch]      master -> master
branch 'master' set up to track 'origin/master'.
PS D:\gitporjects\vuecabulary> 

原因分析

引起该错误的原因是,目录中没有文件,空目录是不能提交上去的

解决方法(提交点东西就行)

touch README
git add .
git commit -m ‘first commit’
git push origin master

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值