Configuration
Once you have Git installed on your machine, its time to set up a few things before starting using Git.
Git config is a tool that lets you get and set configuration variables that control every aspect of Git.
You can view your settings by command,
$ git config --list
When you are using Git first-time it's very important to set your user name and email address because git uses this information when making commits.
$ git config --global user.name “[firstname lastname]”
$ git config --global user.email “[valid-email]”
Note: Replace [firstname lastname] and [valid-email] with your identity information.
The use of –global option sets this information for every repository and git operations you perform on your machine.
You can override this configuration with a different name and email for a specific repository, you can do so by running the same command without the –global option from your repository directory.
You can setup your line ending preferences.
For Linux/Mac
$ git config --global core.autocrlf input
$ git config --global core.safecrlf true
And for Windows
$ git config --global core.autocrlf true
$ git config --global core.safecrlf true
Previous Next