Skip to content

Instantly share code, notes, and snippets.

@kinshuk4
Forked from kickroot/gist:4204368
Last active October 26, 2015 14:17
Show Gist options
  • Save kinshuk4/3f8921d17abdb6048b14 to your computer and use it in GitHub Desktop.
Save kinshuk4/3f8921d17abdb6048b14 to your computer and use it in GitHub Desktop.
Github cheat sheet

We have already seen git commands here, hence won't be repeating it.

Change to your project root folder and do this initially to get your repo set up

# Link remote repo with you local repo.
git remote add alias <Your repo URL>

# Example - Note origin instead of alias
git remote add origin <Your repo URL>
  • origin - default alias of clone repo
  • master - many times this is the branch name we refer to.

Pushing the changes

git push alias <branch_name>

# Example:
git push origin master

Simple git push will also do.

Pulling the changes

git pull origin master
git add .
git commit -am "Initial commit"
git push 

Do this when someone else has updated the repo and you want changes

git pull

Do this whenever you have changes to make permanent

git add . # If you added any files
git commit -am "<Your change message>" #-a for excluding staging area.m for message
git push

Do this to see what your current status is

git status

Why github?

  • Community oriented
  • Social networking (feeds, watch,follow)
  • wiki, issue tracking

Keyboard shortcut on github web

  • T to enter into the search mode. Just start typing the names, and you will find your file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment