git--版本工具的配置及报错信息处理

git
git
git

特别声明:可能因为博客编辑器的问题不能实现两个“- -”所以在中间加入了空格。复制粘贴命令时需要把“- -”中的空格删除

例如:git config - -global user.name “yourName” 需要删除空格

验证命令

安装后执行: git version

返回版本信息,则安装成功

一·基础配置

1.配置用户名(提交时会引用)

git config - -global user.name “yourName”

2.配置用户名(提交时会引用)

git config - -global user.email “yourEmail”

3.其他配置
如果安装KDiff3工具时,使用此配置:

git config - -global mergo.tool “kdif3”

使Git忽略Windows/Unix换行转换符

git config - -global core.autocrlf false

二·编码配置

1.避免git gui中的中文乱码

git config - -global gui.encoding utf -8

2.避免执行git status命令,显示中文文件名乱码

git config - -global core.quotepath off

3.忽略大小写(在Windows上需要配置)

git config - -global core.ignorecase false

三·配置公钥(git ssh key pair 配置)

1.生成ssh key pair

ssh-keygen -t rsa -C “yourEmail”

然后一路回车,不要输入任何内容,生成ssh key pair

2.添加公钥

ssh-add ~/.ssh/id_rsa

如果出现报错执信息:Could not open a connection to your authentication agent. 执行下方命令

eval ‘ssh-agent’ (‘ ’ 是~键上的`)
然后再执行上方命令

3.查看公钥,复制公钥

cat ~/.ssh/id_rsa.pub

4.把公钥,配置到远程仓库上

使用的网站不同配置方式稍有差异,基本类似。

出现以下报错信息,说明公钥,配置到远程仓库上失败。重点检查公钥是否配置在用户下而不是项目下

Access denied
exec request failed on channel 0
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值