git安装及第一次上传代码遇到的问题

1.在https://github.com/注册或者登陆账号

2.在github上新建project

3.安装git客户端https://www.git-scm.com/

4.设置idea

5.在idea上设置git的全局变量:$git config --global user.name 'name'

                                                 $git config --global user.email  'email'

$git --list

$git config --list

6.上传idea的代码

在terminal终端上敲入代码

(1)git init

  (2)git commit -m "注释"

  (3)git remote add origin github地址

(4)git push -u origin master

7.错误:

Counting objects: 76, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (64/64), done.
Wfatal: The remote end hung up unexpectedly bytes/s
rror: RPC failed; result=56, HTTP code = 200ytes/s
Writing objects: 100% (76/76), 24.52 MiB | 0 bytes/s, done.
Total 76 (delta 8), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
Everything up-to-date

原因:

1、网络问题:提交代码到github上,毕竟是外网,所以有所怀疑。不过从GitHub clone 项目速度很快,所以这点排除了。

2、git缓存空间不够:这是网络上大量提供的思路

解决方案:

## 设置http缓存为1000M(大小可以根据需要自行更改) git config --global http.postBuffer 1048576000

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值