Part 1: Understand git and github

Git: Git is a free and distrubuted opensource version control, it helps in maintaining your sourcecode.

Github: It is a remote repository, available as free/premium singups based on your requirement.

Setup:

  1. Download and Install git version control for Windows – https://git-scm.com/

Basic Command:

  1. $ git init  => intializes local giit repository, creates .git folder as well
  2. $ git add <File> => Adds <files> to index or staging folder.                                                        OR   $ git add *  => Adds files recursively
  3. $ git status => Check status of working tree. Shows difference between working tree and staging area
  4. $ git commit => Commit changes from index/staging area to the local repo.
  5. $ git remote
  6. $ git push => Push from Local to Remote repo. Asks password.
  7. $ git pull => Pull the latest from remote repo.
  8. $ git clone => Clones repo into new repo

Push it to Github

  1. Create repository on the Github to which you would like to push it.
  2. git remote add origin your repo name that you created in step1
  3. git push -u origin master ..or push it the existing repository.

References:

Crash Course on Git

Advertisements

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