是否可以为不同的项目使用不同的Git配置? [英] Is it possible to have different Git configuration for different projects?

查看:111
本文介绍了是否可以为不同的项目使用不同的Git配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.gitconfig通常存储在user.home目录中.

我使用不同的身份为A公司和B公司(主要是名称/电子邮件)从事其他项目.我该如何使用两种不同的Git配置,以免签入时使用名称/电子邮件?

I use a different identity to work on projects for Company A and something else for Company B (primarily the name / email). How can I have two different Git configurations so that my check-ins don't go with the name / email?

推荐答案

存储库特定克隆中的.git/config文件是该克隆的本地文件.在那里放置的任何设置只会影响该特定项目的操作.

The .git/config file in a particular clone of a repository is local to that clone. Any settings placed there will only affect actions for that particular project.

(默认情况下,git config会修改.git/config,而不是~/.gitconfig-仅使用--global会修改后者).

(By default, git config modifies .git/config, not ~/.gitconfig - only with --global does it modify the latter.)

这篇关于是否可以为不同的项目使用不同的Git配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆