How to change git user name and email?

How to change git user name and email?

Config, Git, Repository, Setup

66 | 0 | 0

To set global username/email configuration in git config:

Set user name:

Syntax:

git config --global user.name "<name>"

Example:

$ git config --global user.name "First Name Last Name"

Set user email address:

Syntax:

git config --global user.email "<email-address>"

Example:

$ git config --global user.email "name@example.com"

To set repository-specific username/email configuration in git config:

From the command line, change into the repository directory.

Set user name:

Syntax:

git config user.name "<name>"

Example:

$ git config user.name "First Name Last Name"

Set user email address:

Syntax:

git config user.email "<email-address>"

Example:

$ git config user.email "name@example.com"

To verify configuration, open the configuration file:

$ git config --global user.name // Global

Output: It will print the name

$ git config user.name // Repository Specific

Output: It will print the name
$ git config --global user.email // Global

Output: It will print the email address

$ git config user.email // Repository Specific

Output: It will print the email address

 

Comments (0)

🤔

No comments yet, be the first to help

Welcome to CodePits.

CodePits provide a collection of tutorials about many programming languages like PHP, Laravel Framework, Codeigniter Framework, Mysql Database, Bootstrap Front-end Framework, Jquery, Node JS, Ajax Example, APIs, CURL Example, Composer Packages Example, AngularJS, Ionic Framework, etc. 🙌

Other Posts

Categories

Tags

Comment