Git & Github
Git and github is mainly used to version control system .These version controlling is done by using
command line interface or by using the Graphical user interface also we can do in the github. Our will
be placed to the centralized location of the github from that location we can push or pull the code as
per our requirement.
Step1. First we need to create the git hub account after signing the github account we need sign in the
account and create the new repository inside the github account follow the screen shot below:
Step2: Let us create the free account in the github server
Give the name as Githublearning after selecting repository follow next:
Step 3: In this step we will push the code using the command line interface for that we need to install
git bash by visiting the https://git.scm.com for compatable windows or mac os
Step4: After that create an empty directory across the local machine ex: githublearnig
right click and open the git bash over the githublearning and then use following command to push
the code to the github server
*******************************
git config --global user.name "rajivpandey355"
git config –global user.email "rajivpandey355@gmail.com"
#To identify who is working across this command line interface
git init
git add -A
git status
git commit -m "msg"
git remote add origin reponame
git push origin master
git clone reponame
git pull origin master
This is pictorial representation of how the github will work
Github cloning and pulling request
Step1: Login to github and select the link it will directly take you to the clone and download option
where you can download the code to setup the new server
When you click on to clone or download option where you will find copy the link address, after coping
the link enter the following command:
Step4: To pull the code at the public_html directory
$ git clone https://github.com/rajivpandey355/privaterepos.git
Step5:
$ git pull https://github.com/rajivpandey355/privaterepos.git
After pulling the code you can build the server