Git with GitHub

Get Started. It's Free
or sign up with your email address
Rocket clouds
Git with GitHub by Mind Map: Git with GitHub

1. Initial Setup


1.2. Store your creds

1.2.1. MAC tell git to put your next set of credentials in the OSX keychain git config --global credential.helper osxkeychain

1.2.2. PC

1.3. create a directory where you'll store your github repository. (You don't have to store them all in the same place, but it makes sense). EG ~/github or C:\github

2. Day-to-Day Work

2.1. Oops! Did you start doing work before creating a new branch?

2.1.1. No prob. create the branch. what matters is what branch you are in when you commit

2.2. create a branch and checkout

2.2.1. git checkout -b <branch> this combines git branch <branch> git checkout branch

2.3. do work

2.3.1. add changes to git (changed files, new files, new dir) git add <file or parent dir> [<file or dir> <file or dir>...] EG this tells git to track these files for changes

2.3.2. show git changes git diff git status git branch

2.3.3. commit work to the branch git commit -m "<change message>" until you do this, you really haven't done any work in the branch

2.3.4. push committed work to github first time pushing this branch? git push -u origin <branch> additional pushes git push

2.4. First: GitHub GUI

2.4.1. pull request

2.4.2. get approval

2.4.3. merge pull request

2.4.4. delete branch

2.5. Merge to Master & Clean Up

2.5.1. Clean up git status should be up-to-date git checkout master git pull if you need to pull changes others have made git pull origin master git branch -d <old_branch>

3. Get Started

3.1. clone a repo

3.1.1. need to do this before you work w a repo

3.1.2. git clone <url>

3.2. OR, create a new repo

3.2.1. Easiest: Create repo in github & clone Create repo in github clone repo (see above) add files (see Day-to-Day work)

3.2.2. OR, create a new repo from files that exist already gotta fill this in