Git Cheat Sheet
LiveCommon git commands and usage.
Git Cheat Sheet
A quick reference for common Git commands.
git initBasicsInitialize a new Git repository
git clone [url]BasicsClone a repository into a new directory
git statusBasicsShow the working tree status
git add .BasicsAdd all changes to staging area
git commit -m '[msg]'BasicsRecord changes to the repository
git branchBranchingList, create, or delete branches
git checkout [branch]BranchingSwitch branches or restore working tree files
git checkout -b [branch]BranchingCreate and switch to a new branch
git merge [branch]MergingJoin two or more development histories together
git remote -vRemoteList remote repositories
git fetchRemoteDownload objects and refs from another repository
git pullRemoteFetch from and integrate with another repository or a local branch
git pushRemoteUpdate remote refs along with associated objects
git logAdvancedShow commit logs
git diffAdvancedShow changes between commits, commit and working tree, etc
git stashAdvancedStash the changes in a dirty working directory away
git reset --hardAdvancedReset current HEAD to the specified state