WORKING WITH GIT

Git is a free and open source distributed version control system .We can push our files into git as a backup.It is an easy task.All you need is a git hub account.

step 1:install git

$sudo apt-get install git

step 2:create a repository in git hub.

step 3:specify the git configuration settings using git cnfig command.

$git config –global user.name “username”

$git config –global user.email “email id”

step 4: Generate ssh key

ssh-keygen

//ssh is both a program and a network protocol.Its allows a user to run commands on a machine’s command prompt without them being physically present near the machine.

Enter passphrase (empty for no passphrase): [press enter]
Enter same passphrase again: [press enter]

step 4:copy the ssh key and add it in the github repository.

step 5: Intialize empty git repository

$ git init

step 6: enter every file to added

$ git add .

step 6:

$ git commit -m ‘first commit’

$ git remote add origin git@github.com:Username/Repository.git

step 7:

$ git push -u origin master

// ‘git commit’ records changes made to the repository while ‘git push’ updates the remote reference along with the changes.