1.先在github创建一个仓库
2.在本地新建一个空的文件夹并打开git bash 输入以下命令
直接ctrl+c以下代码 然后ctrl+v在git bash里
echo "# upalab" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:Hu-xiao-m/upalab.git(这里输入自己仓库的网址https和ssh均可)
git push -u origin main
然后我出现了这个报错
然后输入以下代码(以下链接换成了ssh)
直接ctrl+c以下代码 然后ctrl+v在git bash里
git remote add origin git@github.com:Hu-xiao-max/upalab.git(输入自己的网址)
git branch -M main
git push -u origin main
然后跳出登陆界面
登陆完允许即可
1.把需要上传的文件拷贝到刚下载的新文件夹内
2.接下来依次输入以下代码即可完成其他剩余操作:
3.git add . (注:别忘记后面的.,此操作是把文件夹下面的文件都添加进来)
4.git commit -m “提交信息” (注:“提交信息”里面换成你需要,如“first commit”)
5.git push -u origin main (注:此操作目的是把本地仓库push到github上面,此步骤需要你输入帐号和密码)
6.OK,刷新网站页面就可以看到已经上传的文件了。
hu211@DESKTOP-MGVVROH MINGW64 /d/githubrepositories (main)
$ git add .
warning: LF will be replaced by CRLF in Project.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/fonts/fontawesome/fontawesome-webfont.svg.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/gitbook-plugin-fontsettings/fontsettings.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/gitbook-plugin-fontsettings/website.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/gitbook-plugin-highlight/ebook.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/gitbook-plugin-highlight/website.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/gitbook-plugin-search-pro/jquery.mark.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/gitbook-plugin-search-pro/search.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/gitbook-plugin-search-pro/search.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/gitbook-plugin-sharing/buttons.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/gitbook.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/style.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gitbook/theme.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in index.html.
The file will have its original line endings in your working directory
hu211@DESKTOP-MGVVROH MINGW64 /d/githubrepositories (main)
$ git commit -m "first"
[main ddf8b91] first
29 files changed, 2587 insertions(+)
create mode 100644 Project.md
create mode 100644 gitbook/fonts/fontawesome/FontAwesome.otf
create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.eot
create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.svg
create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.ttf
create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.woff
create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.woff2
create mode 100644 gitbook/gitbook-plugin-back-to-top-button/plugin.css
create mode 100644 gitbook/gitbook-plugin-back-to-top-button/plugin.js
create mode 100644 gitbook/gitbook-plugin-fontsettings/fontsettings.js
create mode 100644 gitbook/gitbook-plugin-fontsettings/website.css
create mode 100644 gitbook/gitbook-plugin-highlight/ebook.css
create mode 100644 gitbook/gitbook-plugin-highlight/website.css
create mode 100644 gitbook/gitbook-plugin-search-pro/jquery.mark.min.js
create mode 100644 gitbook/gitbook-plugin-search-pro/search.css
create mode 100644 gitbook/gitbook-plugin-search-pro/search.js
create mode 100644 gitbook/gitbook-plugin-sharing/buttons.js
create mode 100644 gitbook/gitbook.js
create mode 100644 gitbook/images/apple-touch-icon-precomposed-152.png
create mode 100644 gitbook/images/favicon.ico
create mode 100644 gitbook/style.css
create mode 100644 gitbook/theme.js
create mode 100644 images/a1.jpg
create mode 100644 images/a2.jpg
create mode 100644 images/a3.jpg
create mode 100644 images/a4.jpg
create mode 100644 images/p1.jpg
create mode 100644 index.html
create mode 100644 search_plus_index.json
hu211@DESKTOP-MGVVROH MINGW64 /d/githubrepositories (main)
$ git push -u origin main
fatal: unable to access 'https://github.com/Hu-xiao-max/upalab.git/': OpenSSL SSL_read: Connection was reset, errno 10054
hu211@DESKTOP-MGVVROH MINGW64 /d/githubrepositories (main)
$ git push -u origin main
fatal: unable to access 'https://github.com/Hu-xiao-max/upalab.git/': OpenSSL SSL_read: Connection was reset, errno 10054
hu211@DESKTOP-MGVVROH MINGW64 /d/githubrepositories (main)
$ git push -u origin main
Enumerating objects: 42, done.
Counting objects: 100% (42/42), done.
Delta compression using up to 4 threads
Compressing objects: 100% (38/38), done.
Writing objects: 100% (41/41), 10.47 MiB | 3.02 MiB/s, done.
Total 41 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To https://github.com/Hu-xiao-max/upalab.git
c494280..ddf8b91 main -> main
branch 'main' set up to track 'origin/main'.
出现这个报错的原因可能是开了代理,我把代理关了
然后再试
还是不行
我关掉了vpn
然后可以了
此时上传成功