标签:缓存 配置文件 local global git 指令 config 大全
1.git config
Git 一共有3个配置文件:
- 仓库级的配置文件:在仓库的 .git/.gitconfig,该配置文件只对所在的仓库有效。
- 全局配置文件:Mac 系统在 ~/.gitconfig,Windows 系统在 C:\Users<用户名>.gitconfig。
- 系统级的配置文件:在 Git 的安装目录下(Mac 系统下安装目录在 /usr/local/git)的 etc 文件夹中的 gitconfig。
# --local:仓库级,--global:全局级,--system:系统级
$ git config <--local | --global | --system> -l
# 查看当前生效的配置信息
$ git config -l
# 编辑配置文件
# --local:仓库级,--global:全局级,--system:系统级
$ git config <--local | --global | --system> -e
# 添加配置项
# --local:仓库级,--global:全局级,--system:系统级
$ git config <--local | --global | --system> --add <name> <value>
# 获取配置项
$ git config <--local | --global | --system> --get <name>
# 删除配置项
$ git config <--local | --global | --system> --unset <name>
# 配置提交记录中的用户信息
$ git config --global user.name <用户名>
$ git config --global user.email <邮箱地址>
# 更改Git缓存区的大小
# 如果提交的内容较大,默认缓存较小,提交会失败
# 缓存大小单位:B,例如:524288000(500MB)
$ git config --global http.postBuffer <缓存大小>
# 调用 git status/git diff 命令时以高亮或彩色方式显示改动状态
$ git config --global color.ui true
# 配置可以缓存密码,默认缓存时间15分钟
$ git config --global credential.helper cache
# 配置密码的缓存时间
# 缓存时间单位:秒
$ git config --global credential.helper 'cache --timeout=<缓存时间>'
# 配置长期存储密码
$ git config --global credential.helper store
标签:缓存,配置文件,local,global,git,指令,config,大全 来源: https://www.cnblogs.com/heysakura/p/12960563.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。