Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git Crash Course Spring 2012

Git Crash Course Spring 2012

Super basic crash course on git - basically a framework for me to rant about

Ben Nicholas

March 16, 2012
Tweet

More Decks by Ben Nicholas

Other Decks in Programming

Transcript

  1. Remotes Repository being served by another computer Named, typically “origin”

    Push and pull trade changes around Friday, March 16, 12
  2. Important commands git status -see what changes are in git

    add - add file to index git commit - create a commit from the index git pull - get commits from a remote repository git push - send commits to a remote repository git clone - Pull a remote repository into a new repository Friday, March 16, 12
  3. Other Commands git stash save - Push a commit into

    the stash git stash apply - Pop a commit into the working directory git log - see a list of commits git reset --hard head - discard all changes/go back to last commit git merge - combine two branches into one git checkout -b - create a new branch and switch to it Friday, March 16, 12
  4. Pull Requests Ask the repo’s owner to take your changes

    Resolved by the main repo pulling from your repo Sent between forks of a project Friday, March 16, 12
  5. Making a new game Get a group of people Fork

    rit-sse/RapDevXI Clone [your username]/RapDevXI Write on your Game Go to your fork on github Click Pull Request - one of the admin’s will apply it Friday, March 16, 12
  6. Questions? reflog! actual repository layout! merging unrelated repos! rewriting history!

    changing branch history! reordering commits! Friday, March 16, 12