御风灰灰
发布于 2024-07-11 / 37 阅读
0
0

git使用

1.部署

1.1 环境搭建

2. 基本应用

3. 常用配置

3.1 编辑用户信息

git config --global user.name xxxx
git config --global user.email xxx

3.2 修改默认编辑器

  1. 修改操作
git config --global core.autocrlf false
git config --global core.safecrlf true
  1. 详细说明
AutoCRLF
#提交时转换为LF,检出时转换为CRLF
git config --global core.autocrlf true

#提交时转换为LF,检出时不转换
git config --global core.autocrlf input

#提交检出均不转换
git config --global core.autocrlf false
SafeCRLF
#拒绝提交包含混合换行符的文件
git config --global core.safecrlf true

#允许提交包含混合换行符的文件
git config --global core.safecrlf false

#提交包含混合换行符的文件时给出警告
git config --global core.safecrlf warn

4. 疑难问题

4.1 Git Clone

  1. 遇到 ‘diffie-hellman-group14-sha1’错误
Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
fatal: Could not read from remote repository. 错误时

使用 如下命令即可

git config --global core.sshcommand "ssh -o KexAlgorithms=+diffie-hellman-group1-sha1"

此类问题上面错误需要什么 诸如 diffie-hellman-group1-sha1 我们动态的去命令中修改就好


评论