错误日志
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