VsCode上传项目GitHub
第一次上传代码至GitHub,踩了很多坑
工具:
Vscode、git
创建repository
1、前提已经注册号了GitHub账号
2、repositories =>> new
3、可以直接填写 Repository name就创建(其余项自己琢磨琢磨)
4、已经在github上创建repository 上,记录 https | ssh 后面需要
官网给了三种上传步骤:(我用的第一种)
# 生成readme文件
echo "# task01" >> README.md
# 初始化项目到github或gitee
git init
# 添加readme文件
git add README.md
# 将本地暂存的修改提交到版本库 "first commit" =>> "提交信息"
git commit -m "first commit" # 这里我的有报错,解决方式下面有
# 修改分支名
git branch -M main
# 远程添加源 你自己的GitHub库(repository)https | ssh
git remote add origin https://github.com/xxx/xxx.git
# 最后一步我又开始错了
git push -u origin main # 这里我的有报错,解决方式下面有
报错:git commit -m “first commit”
我的解决方法
git config --global user.name "用户名" # GitHub使用的用户名
git config --global user.email 邮箱地址 # GitHub使用的邮箱
报错信息 ⬇⬇⬇⬇⬇⬇
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
报错:git push -u origin main
我的解决方法
参考:https://blog.csdn.net/w605283073/article/details/80019696
可以慢慢扩大扩大试试
# 524288000 =>> 5242880000 =>> 1048576000
git config --global http.postBuffer 524288000
报错信息 ⬇⬇⬇⬇⬇⬇
Enumerating objects: 1565, done.
Counting objects: 100% (1565/1565), done.
Delta compression using up to 8 threads
Compressing objects: 100% (1542/1542), done.
error: RPC failed; curl 28 OpenSSL SSL_read: Connection was reset, errno 10054
fatal: the remote end hung up unexpectedlyiB | 21.00 KiB/s
Writing objects: 100% (1565/1565), 5.35 MiB | 118.00 KiB/s, done.
Total 1565 (delta 123), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
good luck