首先在GitHub官网上注册一个账号
https://github.com
步骤
第一步:点击start a project
第二步:给你的本地仓库起名,填写描述,选择公开还是私有,创建仓库
第三步:保留你仓库的地址:https://github.com/stefan-jie/vueFrame.git(很重要!)
第四步:在你要上传的项目目录下右击,git bash here
第五步:依次输入如下命令
1.git初始化
$ git init
2.提交
$ git commit -m "第一次提交框架"
3.绑定远程仓库
$ git remote add origin https://github.com/stefan-jie/vueFrame.git
4.开始上传
$ git push -u origin master
接下来会弹框,输入账号密码login即可
如下为整个上传过程
Alan@JIE MINGW64 /e/框架/前端/frame (master) $ git init Initialized empty Git repository in E:/框架/前端/frame/.git/ Alan@JIE MINGW64 /e/框架/前端/frame (master) $ git add . 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 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/components/HelloWorld.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in src/router/index.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in src/store/index.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in src/views/About.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in src/views/Home.vue. The file will have its original line endings in your working directory Alan@JIE MINGW64 /e/框架/前端/frame (master) $ git commit -m "第一次提交框架" [master (root-commit) f0b3f85] 第一次提交框架 16 files changed, 11901 insertions(+) create mode 100644 .gitignore 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/assets/logo.png create mode 100644 src/components/HelloWorld.vue create mode 100644 src/main.js create mode 100644 src/router/index.js create mode 100644 src/store/index.js create mode 100644 src/untils/interceptor.js create mode 100644 src/views/About.vue create mode 100644 src/views/Home.vue Alan@JIE MINGW64 /e/框架/前端/frame (master) $ git remote add origin https://github.com/stefan-jie/vueFrame.git Alan@JIE MINGW64 /e/框架/前端/frame (master) $ git push -u origin master Logon failed, use ctrl+c to cancel basic credential prompt. Username for 'https://github.com': Alan@JIE MINGW64 /e/框架/前端/frame (master) $ git push -u origin master Logon failed, use ctrl+c to cancel basic credential prompt. Username for 'https://github.com': stefan-jie remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/stefan-jie/vueFrame.git/' Alan@JIE MINGW64 /e/框架/前端/frame (master) $ git push -u origin master Enumerating objects: 26, done. Counting objects: 100% (26/26), done. Delta compression using up to 4 threads Compressing objects: 100% (21/21), done. Writing objects: 100% (26/26), 86.47 KiB | 2.54 MiB/s, done. Total 26 (delta 0), reused 0 (delta 0) To https://github.com/stefan-jie/vueFrame.git * [new branch] master -> master Branch 'master' set up to track remote branch 'master' from 'origin'.
上传成功
小结
此次上传过程默认已经下载了git,另外已经填写了Git username和password