All Articles

Setup git config for project


Normally, we setup git username and email globally with following commands:

git config --global "FIRST_NAME LAST_NAME"
git config --global ""

This is not convenience if we are using one PC for multiple organization. For example, use your PC for both company works and your side projects.


To configure username and email within project. Go to git repository and run commands:

git config ""

Here, we remove --global parameter. We can check the configuration with following command:

cat .git/config

It should output something like this:

$ cat .git/config
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
	precomposeunicode = true
[remote "origin"]
	url =
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
	name = Phil Nguyen
	email =