git config --xx --xxx 参数 【汇总】

前言全局说明

git config --xx --xxx 参数 【汇总】


一、说明

1.1 默认配置文件路径

Windows
C:\Program Files\Git\etc\gitconfig
Linux 默认证书路径
/home/${USER}/.gitconfig

注意: .gitconfig 是隐藏文件,需要用 ls -a 命令才能看到


二、查看全局配置

2.1 列出查看全部配置内容

git config --list

2.5 编辑

  1. Git配置文件
git config -e

三、system 系统级配置文件

3.1 列出查看全部配置内容

git config --system --list

3.2 关闭证书校验

git config --system http.sslverify false

3.3 指定仓库登录密钥证书路径:

git config --system http.sslcainfo "D:\Git\mingw64\ssl\certs\ca-bundle.crt"

注意: 不要放到项目路径下,会泄露


四、 global 全局配置文件

4.1 列出查看全部配置内容

git config --global --list

4.2 创建 git 自己的别名

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"

4.3 查看指定内容

  1. 查看设置提交者名字和邮箱email
git config --global --list |grep user
  1. 查看 git 别名
git config --global --list |grep alias

4.4 设置

  1. 设置,新仓库提交者名字
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"

4.5 编辑

  1. Git配置文件
git config -e [--global]

4.6

4.7


五、查看 local 仓库级配置文件

4.1 列出查看全部配置内容

git config --local --list


免责声明:本号所涉及内容仅供安全研究与教学使用,如出现其他风险,后果自负。




参考、来源:
https://www.cnblogs.com/wutou/p/17769495.html
https://www.cnblogs.com/wutou/p/17491426.html



posted @   悟透  阅读(136)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示