Git Installation

Git Installation In Windows

Step 1: Download git from git-scm.com

download

Step 2: Launch setup file.

launch

Step 3: Click on Next button and at 4th step choose “Use Git from Bash only” option and click on Next until finish.

git_bash

Step 4: After installation finished, Open Git bash.

recently_added

git_terminal

 

Git Installation In Linux (Ubuntu)

Step 1 : Open terminal and update packages using below command.

root@ubuntu:~# apt-get update

Step 2: Run below command to install Git.

root@ubuntu:~# apt-get install git
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following extra packages will be installed:
 git-man liberror-perl
Suggested packages:
 git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
 git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 324 not upgraded.
Need to get 3,539 kB of archives.
After this operation, 23.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu/ vivid/main liberror-perl all 0.17-1.1 [21.1 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main git-man all 1:2.1.4-2.1ubuntu0.1 [701 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main git amd64 1:2.1.4-2.1ubuntu0.1 [2,817 kB]
Fetched 3,539 kB in 15s (234 kB/s) 
Selecting previously unselected package liberror-perl.
(Reading database ... 171176 files and directories currently installed.)
Preparing to unpack .../liberror-perl_0.17-1.1_all.deb ...
Unpacking liberror-perl (0.17-1.1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../git-man_1%3a2.1.4-2.1ubuntu0.1_all.deb ...
Unpacking git-man (1:2.1.4-2.1ubuntu0.1) ...
Selecting previously unselected package git.
Preparing to unpack .../git_1%3a2.1.4-2.1ubuntu0.1_amd64.deb ...
Unpacking git (1:2.1.4-2.1ubuntu0.1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up liberror-perl (0.17-1.1) ...
Setting up git-man (1:2.1.4-2.1ubuntu0.1) ...
Setting up git (1:2.1.4-2.1ubuntu0.1) ...
root@ubuntu:~# 

Step 3: Go to your work directory and initialize the work space git repository using following command.

root@ubuntu:~# logout
sree@ubuntu:~$ 
sree@ubuntu:~$ cd Documents/
sree@ubuntu:~/Documents$ git init
Initialized empty Git repository in /home/sree/Documents/.git/
sree@ubuntu:~/Documents$

Without initializing, you can’t execute git command. 

sree@ubuntu:~/Documents$ cd ..
sree@ubuntu:~$ 
sree@ubuntu:~$ git add .
fatal: Not a git repository (or any of the parent directories): .git
sree@ubuntu:~$
Advertisements