Github Git Cheat Sheet
Github Git Cheat Sheet
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 diff [first-branch]...[second-branch] CAUTION! Changing history can have nasty side effects. If you
Shows content differences between two branches need to change commits that exist on GitHub (the remote),
proceed with caution. If you need help, reach out at
$ git show [commit] github.community or contact support.
Outputs metadata and content changes of the specified commit
GitHub Flow
‘master’ branch
Create ‘feature’ branch from ‘master’ Merge ‘feature’ branch into ‘master’
Glossary
git: an open source, distributed version-control system
GitHub: a platform for hosting and collaborating on Git repositories
commit: a Git object, a snapshot of your entire repository compressed into a SHA
branch: a lightweight movable pointer to a commit
clone: a local version of a repository, including all commits and branches
remote: a common repository on GitHub that all team member use to exchange their changes
fork: a copy of a repository on GitHub owned by a different user
pull request: a place to compare and discuss the differences introduced on a branch with reviews, comments, integrated
tests, and more
HEAD: representing your current working directory, the HEAD pointer can be moved to different branches, tags, or commits
when using git checkout
Training
Want to learn more about using GitHub and Git? [email protected]
Email the Training Team or visit our web site for learning services.github.com
event schedules and private class availability.