VsCode上传项目GitHub

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
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值