Git setup in Linux OS

Git setup in Linux OS, Git is the most widely used version control system for software development. This a distributed revision control system provides speed, data integrity, and support for distributed, non-linear work flows.For you knowledge, Git was initially designed and developed by Linus Torvalds in 2005.The actual purpose was Linux kernel development.Later it changed the face of managing projects.

I am not going to explain all the git commands here. I am just explaining the basic commands and configurations to successfully integrate the git with your project, to simplify your work.
OK.Let’s start with the installation procedure.

Git Installation

For Fedora:

 $ sudo yum install git-all

For Ubuntu:

 $ sudo yum install git-all

Git Configuration

Initializing the git in your project folder.This will create a .git folder inside your project folder.Git tracks all your file changes and save it in this folder.So, do not delete this.Also, on deployment time, change the permission of this folder only to
root user. ./git folder can be use to exploit/hack your website.

$ cd (your project folder)/
$git init 
 $git config --global "YOUR NAME"
 $git config --global "YOUR EMAIL ADDRESS"

Git Authentication

Git uses HTTPS or SSH to authenticate with the git repository.If you are using HTTPS, it will ask for password, whenever you push or pull from the repository.If you setup SSH Keys, you can avoid that. Otherwise, there is no difference.

Git Commands

To find status of files :

 $git status

To add all files for stages :

 $git add -A

To add a single file :

 $git add filename1,filename2...

Message for each commit:

 $git commit -m "Your message when committing"

Push to repository:

 $git push

Pull from repository :

 $git pull
 $git pull origin master

List branches:

 $ git branch

Switch branches :

 $ git checkout branch-name

Create and switch branch :

 $ git checkout -b branch-name

Merge a branch back to the master branch:

 $ git checkout master
 $ git merge branch-name

To clone a repository:

 $ git clone

To remove all the changes you have made :

 $git stash

Also, my personal recommendation for using as a repository is BitBucket. It provides private repo for 5 members with free of cost.GitHub doesn’t provide private repositories.

Also,you can checkout some sample project i have done in GitHub a longtime ago using this link : GitHub Projects

Note: Git is an essential part of project development now.Start using it now.