How to Install and Configure GIT on Ubuntu | InfoZonePK

Git is an open source version control system. Git is developed and maintained by the creator of the Linux kernel. Git stores complete files each time the user commits his changes, making recovery and version-diffing reliable, responsive and simple.

Here are the commands to install and configure Git on Ubuntu:

sudo apt-get install git-core gitosis git-doc

Create GIT user

sudo adduser git

Creating directory for repositories

sudo mkdir /home/git/yourrepositories

sudo chmod 775/home/git/yourrepositories

Run this command on your repositories

git init

git add

git commit -a -m “your commit comments”

How to use GIT repository on Window

Download GIT

Install this software on your computer

Ryn this command

git clone username@192.168.20.11:~/complete/path/here/projectname foldername

projectname* is project you want to lone

foldername* is a name of folder where you want to clone the project by default clone with same projectname

cd foldername/

git branch

to check the list of branched exits

git checkout -b new_branch

create new branch for your clone project

Push Data to Master

git add

to add changes and new file to repository git commit -a -m ‘your comment about changes’

git push origin new_branch

Merge Data Master Branch

git merge new_branch

that it is to be done on the system from which clone is done

Get recent Changes from Master

git pull origin master