github使用问题

1.在用户主目录创建.ssh目录(linux也一样~/.ssh)

输入命令

ssh-keygen -t rsa -C "1715269118@qq.com"

2.git报错 fatal: unsafe repository

参考:博客

输入这个命令即可

git config --global --add safe.directory "*"

3.http问题

error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500

fatal: the remote end hung up unexpectedly

fatal: the remote end hung up unexpectedly

在使用git Bash克隆项目的是候出现以上问题:
首先是因为http协议进行传输的缓存区太小了,解决方法如下:
在 git bash下执行

git config http.postBuffer 524288000

4.一个主机配置多个github用户,~/.ssh/config

先删除全局配置

# 移除全局配置账户
git config --global --unset user.name
#查看全局用户名
git config --global user.name
# 移除全局配置邮箱
git config --global --unset user.email
# 查看全局邮箱
git config --global user.email
    # Host: 主机别名
    # HostName: 托管平台域名地址,如github.com
    # IdentityFile : 指明上面User对应的identityFile路径
    # User: 托管平台用户名
    # Port: 端口号,可不填(如果不是默认22号端口则需要指定)
    # PreferredAuthentications publickey
//例子
Host    gongsi_neiwang
HostName    192.168.120.200
User    git
Port    8081
IdentityFile    ~/.ssh/id_rsa

最后具体每个项目

#配置用户1的姓名
git config user.name "用户1"
#配置用户1的邮箱。
git config user.email “your_email@163.com”

5.文件太大

git filter-branch -f –index-filter “git rm -rf –cached –ignore-unmatch FOLDERNAME” – –all

把FOLDERNAME换成路径。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值