Change email address in Git

前端 未结 5 1514
耶瑟儿~
耶瑟儿~ 2021-01-30 00:17

I have a project hosted in Git stash (now rebranded as Bitbucket Server). It is built using jenkins. Now I made a typo while installing my Git locally. Like @ab.com instead of @

5条回答
  •  暖寄归人
    2021-01-30 01:04

    Locally set email-address (separately for each repository)

    1. Open Git Bash.

    2. Change the current working directory to the local repository in which you want to set your Git config email.

    3. Set your email address with the following command:

    git config user.email "your_email@abc.com"
    
    1. Confirm that you have set your email address correctly with the following command.
    git config user.email
    

    Globally set email-address (only used when nothing is set locally)

    1. Open Git Bash.

    2. Set your email address with the following command:

    git config --global user.email "your_email@abc.com"
    
    1. Confirm that you have set your email address:
    git config --global user.email
    

    Or using environment variables

    1. GIT_COMMITTER_EMAIL=your_email@abc.com
    2. GIT_AUTHOR_EMAIL=your_email@abc.com

    PD: Info from github official guide

提交回复
热议问题