Skip to content

Instantly share code, notes, and snippets.

@hemantajax
Created February 14, 2013 12:23
Show Gist options
  • Save hemantajax/4952444 to your computer and use it in GitHub Desktop.
Save hemantajax/4952444 to your computer and use it in GitHub Desktop.
how to use git
How to use git
git init
git status
git add .
git commit -m "my 1st commit"
git log
sign in or create your GitHub account.
git remot­e add origi­n git@g­ithub.com:­hemantajax­/try_git.g­it
git push -u origi­n maste­r
Pulling Remotely: git pull origi­n maste­r
git diff HEAD
git diff --sta­ged
Resetting the Stage: git reset­ octof­amily/octo­dog.txt
Undo: git check­out -- octoc­at.txt
Create new branch: git branch clean_up
Switching Branches: git check­out clean­_up
Removing All The Things: git rm "*.txt"
Commiting Branch Changes: Commiting Branch Changes
Switching Back to master: git checkout master
Preapring to merge: git merge clean_up
Removing branch: clean branch -d clean_up
The final push: git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment