The Git story: Git installation and configuration

Git can be installed on Windows,linux and mac-os Packages can be downloaded from: www.git-scm.com.

For windows and MAC, we can download offline packages.for linux vendors provide the repo location

Debian/Ubuntu
$ apt-get install git
Fedora
$ yum install git
Gentoo
$ emerge –ask –verbose dev-vcs/git
Arch Linux
$ pacman -S git
openSUSE
$ zypper install git
FreeBSD
$ cd /usr/ports/devel/git
$ make install
Solaris 11 Express
$ pkg install developer/versioning/git
OpenBSD
$ pkg_add git

In my lab vm, I have installed using yum.

yum install git

# git –version
git version 1.7.1

git maintain the three configuration files:

system:
Linux : /etc/gitconfig
Windows: program files/git/etc/gitconfig

user:
Windows: ~/.gitconfig
Linux: $HOME\.gitconfig

project:
my_project/.git/config
From command line , if we want to modify file:
-System
git config –system
-User
git config –global
-Project
git config

Lab commands:
git config –global user.name “Amit”
git config –global email.name “Amit@openwriteup.com”

git config –list

user.name=Amit
email.name=Amit@openwriteup.com

git config user.name

ls -la
cat .gitconfig
[user]
name = Amit
[email]
name = Amit@openwriteup.com

For setting Vim editor and color

git config –global core.editor “vim” ; git config –global color.ui true
git config –list
user.anme=Amit
user.name=Amit
email.name=Amit@openwriteup.com
core.editor=vim