Friday, September 20, 2013

GitHub 2

I recently help some friends learn Git!!... here is the code to do stuff on GitHub...

// Installing Git on Ubuntu
sudo apt-get install git-core
//Git version
Git –version
//Add Colors to console
git config --global color.ui auto
// Status of Repo
git status
//Structure of Git
Tree .git
//See branches
Git branch -a
//See the origins
Git remote –v
//See the log
Git log
//See the recent changes
Git whatchanged
//Deleting Remote Origin
git remote rm origin




1st Creating Identity
//Global User Name
git config --global user.name "Example Surname"
//Global Email
git config --global user.email "your.email@gmail.com"


2nd Creating A Repo
//Initialize Git
Git init
//Make Changes to repo
//Stage your Changes
Git add README
//Commit the Staging area
Git commit –m ‘my first commit’
//Creating a URL linking to your repo
//Pushing your commit
git push origin master
//Make changes in repo
//To see the difference between the master and local
git fetch origin
git diff master origin/master
(git merge origin/master)
//Pulling from Origin
git pull origin master


3rd Forking
//Fork 1st + Copy the address and use the url to clone
Git clone 
//Create a branch
Git branch
//Checkout to the branch
Git checkout
//Create changes to that branch
Gedit …..
//Maybe do a status
//ADD and Commit
//Push it to the
Git push –u origin
//Check it out to update the file system
Git checkout master



No comments:

Post a Comment