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:

For Ubuntu:

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.

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 :

To add all files for stages :

To add a single file :

Message for each commit:

Push to repository:

Pull from repository :

List branches:

Switch branches :

Create and switch branch :

Merge a branch back to the master branch:

To clone a repository:

To remove all the changes you have made :

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.

1 Comment

  1. Pingback: Push backups automatically to Git Repository - Preprogrammer

Leave a Comment

Your email address will not be published. Required fields are marked *