Backlog uses cookies to deliver our services. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.

Set up user name/email address

$ git config --global user.name <username>
$ git config --global user.email <mailaddress>

Without the --global option, this setting will only apply to a specific repository.

Color the displayed output

$ git config --global color.ui auto

Set alias for Git command

$ git config --global alias.<aliasname> <commandname>

Remove files from version control tracking

$ echo <filename> >> .gitignore

Add the paths of files under .gitignore. Git will no longer manage those files. You will have to commit the .gitignore file for this to work.

Track empty directories under version control

$ cd <dirname>
$ touch .gitkeep

Git does not track empty directories. If you would like to add that to the version control, you will need to place a file in that directory. A common practice that people normally do is to add a .gitkeep file to the empty directory.

Display settings

$ git config --global --list

Setup a HTTP connection to a proxy server

Add the following setting to the http items of .gitconfig files.

[http]
proxy = <address of the proxy server>:<port of the proxy server>

You can also configure it using the following config command:

$ git config --global http.proxy <address of the proxy server>:<port of the proxy server>

Establish a HTTP connection to a user authenticated proxy server

Add the following setting to the http items of .gitconfig files.

[http]
proxy = http://<username>:<password>@<address of the proxy server>:<port of the proxy server>

You can also configure it using the following config command

$ git config --global http.proxy http://<username>:<password>@<address of the
proxy server>:<port of the proxy server>