Skip to content

Git & github

February 5, 2011

Install git-core package in your system

$sudo apt-get install git-core

go to ur project directory. At first to create a empty repository

$ git init

add our code into empty repostitary

$ git add .

after u make an any change to commit into ur git repo

$ git commit -m “Initial commit”   #ur comments in double quote
===========================================================

github:

create an account in github.com

install ssh in ur system

$ sudo apt-get install ssh

if already ssh installed means u generate a new key using following commands

$ ssh-keygen -t rsa -C  “ksrajkumar87@gmail.com” # your mail id

to add ur ssh key to github site

$cd ~/.ssh

$gedit  id_rsa.pub

to copy the whole content

and open your github.com account and go account settings=>ssh publc keys=>add another public key=> to paste your key in the key field

and create a repository in dashboard

configure  git with the ur system and git account at  first time only

$ cd project_dir # go to ur project directory

$ git config –global user.name “ksrajkumar” #github user name

$ git config –global user.email ksrajkumar87@gmail.com # your mail ID

above two steps are first time paring only

to open your project directory to upload your local git into github site

$ git remote add origin git@github.com:ksrajkumar/first_app.git

$ git push origin master

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: