Git and Git Hub
Git and Git Hub
Git and Git Hub
Git is the open source distributed version control system that facilitates GitHub activities on your laptop or
desktop. This cheat sheet summarizes commonly used Git command line instructions for quick reference.
Git distributions for Linux and POSIX systems are available on the Snapshots the file in preparation for versioning
official Git SCM web site. $ git diff --staged
Git for All Platforms Shows file differences between staging and the last file version
http://git-scm.com
$ git reset [file]
Creates a new local repository with the specified name Combines the specified branch’s history into the current branch
$ git clone [url] $ git branch -d [branch-name]
Downloads a project and its entire version history Deletes the specified branch
GIT CHEAT SHEET
Deletes the file from the working directory and stages the deletion Lists version history for the current branch
Removes the file from version control but preserves the file locally Lists version history for a file, including renames
Changes the file name and prepares it for commit Shows content differences between two branches
$ git show [commit]
*.log
REDO COMMITS
build/ Erase mistakes and craft replacement history
temp-*
$ git reset [commit]
A text file named .gitignore suppresses accidental versioning of
files and paths matching the specified patterns Undoes all commits after [commit], preserving changes locally
Lists all ignored files in this project Discards all history and changes back to the specified commit
Temporarily stores all modified tracked files Downloads all history from the repository bookmark
$ git stash pop $ git merge [bookmark]/[branch]
Restores the most recently stashed files Combines bookmark’s branch into current local branch
$ git stash list $ git push [alias] [branch]
Lists all stashed changesets Uploads all local branch commits to GitHub
$ git stash drop $ git pull
Discards the most recently stashed changeset Downloads bookmark history and incorporates changes
Learn more about using GitHub and Git. Email the Training Team or visit [email protected]
our web site for learning event schedules and private class availability. training.github.com