Git: Set local user.name and user.email different for each repo

前端 未结 2 865
执念已碎
执念已碎 2020-12-23 02:46

I\'m currently working on 2 projects, which expect that I configure my local username and email with different data when I push to them.

for that I\'m updaing my con

相关标签:
2条回答
  • 2020-12-23 03:16

    For just one repo:

    git config user.name "Your Name Here"
    git config user.email your@email.com
    

    For (global) default email (which is configured in your ~/.gitconfig):

    git config --global user.name "Your Name Here"
    git config --global user.email your@email.com
    
    0 讨论(0)
  • 2020-12-23 03:24

    You can confirm that by printing on the terminal:

    1. Global user:git config --global user.name
    2. Local user: git config user.name
    0 讨论(0)
提交回复
热议问题