snippetjavascriptTip
Configure Git user information
Viewed 0 times
configureuserinformationgit
Problem
Configuring Git user information is essential to associate commits with a user. This information is used to identify the author of a commit and is displayed in the commit history.
You can either set this information globally (for all repositories) or locally (for the current repository). In both cases, you need to use
More specifically, you can use
You can either set this information globally (for all repositories) or locally (for the current repository). In both cases, you need to use
git config to specify the user information.More specifically, you can use
git config user.email <email> to set the user's email and git config user.name <name> to set the user's name. You can also use the --global flag to configure global user information.Solution
# Syntax:
# git config [--global] user.email <email>
# git config [--global] user.name <name>
# Configure user for current repository
git config user.email "cool.duck@qua.ck"
git config user.name "Duck Quackers"
# Configure global Git user
git config --global user.email "cool.duck@qua.ck"
git config --global user.name "Duck Quackers"More specifically, you can use
git config user.email <email> to set the user's email and git config user.name <name> to set the user's name. You can also use the --global flag to configure global user information.Code Snippets
# Syntax:
# git config [--global] user.email <email>
# git config [--global] user.name <name>
# Configure user for current repository
git config user.email "cool.duck@qua.ck"
git config user.name "Duck Quackers"
# Configure global Git user
git config --global user.email "cool.duck@qua.ck"
git config --global user.name "Duck Quackers"Context
From 30-seconds-of-code: config-user
Revisions (0)
No revisions yet.