This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Git Cheat Sheet
Cloning the Spree repository from Github
git clone git://github.com/railsdog/spree.git spree
Cloning a Spree fork from Github (your own or someone else’s)
git clone git://github.com/yourname/spree.git spree-fork
Updating your fork to grab the latest changes from the official repo
git remote add railsdog git://github.com/railsdog/spree.git git checkout -b railsdog/master git pull railsdog master git checkout master git merge railsdog/master
Subsequent merge with the mainline (after your first merge above)
git checkout railsdog/master git pull railsdog master git checkout master git merge railsdog/master
Throw away your uncommitted changes
git reset --hard
List the branches in your fork (and show current one)
git branch
Delete a branch (automatically stopping you if changes haven’t been merged)
git branch -d branch-name
Delete a branch (abandon all work on the branch regardless of whether it has been merged)
git branch -D branch-name
Cherry pick a single change from the official repository (or someone else’s fork)
git checkout -b cherry-pick git fetch git://github.com/railsdog/spree.git git cherry-pick -x e0277f3cd2c0952516a git checkout master git merge cherry-pick
Undo the last commit (assuming you haven’t pushed yet.)
git reset --soft HEAD^
Delete a remote branch (including github)
git push origin :branchname
Push your tags to a remote source (including github)
git push --tags
Apply a git patch file (as opposed to merging a github fork)
git apply patch_filename.diff
Make a diff of two branches (your master and railsdog/master) to see what is different
git diff master..railsdog/master
Create a branch based on the original railsdog/master instead of the current branch (if you screwed up your branch)
git checkout -b railsdog/master railsdog/master git pull railsdog master
Work on an “upstream” branch other then master
git checkout --track -b <local name> origin/<remote name>
Note: this creates a local branch
Examine an earlier version of your source
Example: You want to create a local branch to examine the initial commit
git checkout c32e3074f4130 git checkout -b initial_commit
Tell git to remove files that are deleted in file system but not yet removed from index (instead of git rm on all of them)
git add -u






