Can I specify multiple users for myself in .gitconfig?

后端 未结 20 2592
无人及你
无人及你 2020-11-22 06:33

In my ~/.gitconfig, I list my personal email address under [user], since that\'s what I want to use for Github repos.

But, I\'ve recently s

20条回答
  •  余生分开走
    2020-11-22 07:05

    Although most questions sort of answered the OP, I just had to go through this myself and without even googling I was able to find the quickest and simplest solution. Here's simple steps:

    • copy existing .gitconfg from your other repo
    • paste into your newly added repo
    • change values in .gitconfig file, such as name, email and username [user] name = John email = john@email.net username = john133
    • add filename to .gitignore list, to make sure you don't commit .gitconfig file to your work repo

提交回复
热议问题