Using GitHub

GitHub is an open source version control system (VCS) called Git*. Created by the same team that created Linux.

Using Git Hub on other platforms like Windows or Linux has no such difference you just need to download the respective binaries for your platform with platform dependent Git.

Here are some steps you need to use Git Hub:

Setting Up Git Hub

  1. Download Git Hub for windows (check above links for other platform):
  2. Download Git:
  3. Create an account on Git Hub
  4. Open Git Shell or use Git GUI
  • Using Git Shell:
    1. git config –global “Your Name Here”
    2. git config –global
    3. Done

 Create a Repo

  1. Go to this url to create a new repo
  2. Put a name for a repo and create it. (this is on remote server)
  3. Done

 Setup a local git

  1. Open Git Shell
  2. Change path to working directory (Assuming you have some working directory)
  3. Type git init
  4. Done

Commit your code

  1. Add files to your local git. git add someFile.someExt or git add some directory
  2. git commit –m “Some description what has been commit and why”
  3. Done

Push your commits to remote

  1. git remote add origin
  2. git push origin master
  3. Checkmate! // Note that “origin” is a remote name

 Forking a repo

  1. Go to a project page
  2. Click on fork button
  3. Clone this project to local by running: git clone
  4. This will add to current working directory

 Up-streaming a git

  1. Go to project directory using shell
  2. git remote add upstream (forked git url)
  3. git fetch upstream

Pull in up-stream changes

  1. git fetch upstream
  2. git merge upstream/master

Creating a Branch

  1. git branch mybranch
  2. git checkout mybranch
  • or
  1. git checkout -b mybranch

To switch

  1. git checkout master
  2. git checkout mybranch

Merging back the branch

  1. git checkout master
  2. git merge mybranch
  3. git branch -d mybranch

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s