skip navigation

www.Hilands.com


Content:: Installing and Configuring Git :: www.hilands.com

Installing and Configuring Git
Application: Git
OS: Debian Wheezy (7.x)
Last Modified: 2013-09-06
Git is a free and open source distributed version control system. It is simple to use, versatile and can be used on a local system without the need for a server.
This document will focus on the usage on a Debian system.

Table of Contents
Installing on Debian
If we do a search for GIT in the mainstream apt repository we will get a laundry list of things to install. # apt-cache search git |grep ^git |less
Here we will be grabbing the git-core package. Notice the output of our apt-cache search shows git core as obsolete.
git-core - fast, scalable, distributed revision control system (obsolete)
This is what I have used in the past and will continue to use until it disappears..... # apt-get install git-core
Configuration
The configuration files on our debian system are saved in the home directory in a file named .gitconfig. You can view this file to see all of our configuration preferences. $ nano ~/.gitconfig

We can use "git config" via the command line to edit the configuration file that is local to your user "profile."

$ git config --global user.name "Philip Allen"
$ git config --global user.email "phil@hilands.com"


Upon running these commands a new file named ".gitconfig" will appear in your home directory. The file will show a user section with a defined name and email variable. $ nano ~/.gitconfig
[user]
        name = Philip Allen
        email = phil@hilands.com

We can view the configurations we just set by using git config with the parameter of the configuration option.
To view the user name we can use $ git config user.name
To view the user email we can use $ git config user.email
We can set our default editor by adding core.editor $ git config --global core.editor "nano"

You can also change the color output of data from the git console. This is very useful while you are learning and trying to read the output. $ git config --global color.ui true

To view the configuration changes we have made we can run with the --list switch. $ git config --list
We can also get more information similar to a man page about get with the --help switch. $ git config --help

References