Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有可能在某个 user.name 和 user.email 下拥有一些项目以及其他具有其他 git 用户设置的项目。
根据我必须处理的项目类型,我想在两个不同的用户名下进行开发。你知道它是否以及如何可能?
要为单个存储库设置用户名和电子邮件,您可以使用与正常相同的命令(git config --global user.email "EMAIL"和git config --global user.name "NAME"),但没有全局标志(即git config user.email "EMAIL"和git config user.name "NAME")。这会将您的用户名和电子邮件设置为您仅为当前存储库指定的任何值。
git config --global user.email "EMAIL"
git config --global user.name "NAME"
git config user.email "EMAIL"
git config user.name "NAME"