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

2.在github上新建project

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

4.设置idea

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

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

 

 

 

 

相关文章:

  • 2021-12-25
  • 2021-08-28
  • 2021-07-26
  • 2021-09-05
  • 2021-06-27
  • 2022-12-23
  • 2021-06-03
猜你喜欢
  • 2021-09-24
  • 2021-07-10
  • 2022-12-23
  • 2022-01-19
  • 2021-11-01
  • 2021-11-23
相关资源
相似解决方案