Github Commands

This is a collection of commands I use to get git up and running in various projects

Initialize Git
Set a Global Username $ git config --global user.name "Your Name"
Set a Global Email Address $ git config --global user.email "Your Email"
$ git config --global push.default matching
$ git config --global alias.co checkout
Initialize Repo $ git init
Add Files To Git
Add All Files to Git Repo $ git add .
Commit Changes and Add a Message $ git commit -am "Commit Message"
Push Code (Check Github Specific Links if pushing to GH) $ git push
Roll Back Code To Last Commit
Roll Back Code To Last Commit $ git checkout .
Branches
See What Branch You're On $ git status
Create and Switch To A New Branch $ git checkout -b BranchName
Switch To A Different Branch (Already Created) $ git branch BranchName
Push Branch To Github $ git push origin BranchName
Push Master Branch To Github $ git push origin master
Switch Back To Your Master Branch $ git checkout master
Merge Branch Back Into Master Branch while checked in to branch $ git merge
Merge Branch Back Into Master Branch while checked in to master branch $ git merge BranchName
Delete Old Branch After You've Merged It To Master $ git branch -d oldBranchName
Resolve Merge Conflicts Visually $ git mergetool
Set up and push to Heroku
Test to see if you have the heroku toolbelt installed $ heroku --version
Login To Heroku $ heroku login
Create An App $ heroku create
Rename Your App At Heroku $ heroku rename ENTERNAME
Push Your Code $ git push heroku master