Getting Started
Create a Repository
Create a new local repository
Clone a repository
Clone a repository into a specified directory
Make a change
Show modified files in working directory, staged for your next commit
Stages the file, ready for commit
Stage all changed files, ready for commit
Commit all staged files to version history
Commit all your tracked files to version history
Discard changes in working directory which is not staged
Unstage a staged file or file which is staged
Unstage a file, keeping the file changes
Revert everything to the last commit
Diff of what is changed but not staged
Diff of what is staged but not yet committed
Apply any commits of current branch ahead of specified one
Configuration
Set the name that will be attached to your commits and tags
Set an email address that will be attached to your commits and tags
Enable some colorization of Git output
Edit the global configuration file in a text editor
Working with Branches
List all local branches
List all branches, local and remote
Switch to my_branch, and update working directory
Create a new branch called new_branch
Delete the branch called my_branch
Merge branchA into branchB
Tag the current commit
Observe your Repository
Show the commit history for the currently active branch
Show the commits on branchA that are not on branchB
Show the commits that changed file, even across renames
Show the diff of what is in branchA that is not in branchB
Show any object in Git in human-readable format
Synchronize
Fetch down all the branches from that Git remote
Merge a remote branch into your current branch to bring it up to date
$ git merge [alias]/[branch]
# No fast-forward
$ git merge --no-ff [alias]/[branch]
# Only fast-forward
$ git merge --ff-only [alias]/[branch]
Transmit local branch commits to the remote repository branch
Fetch and merge any commits from the tracking remote branch
Merge just one specific commit from another branch to your current branch
Remote
Add a git URL as an alias
Show the names of the remote repositories you've set up
Show the names and URLs of the remote repositories
Remove a remote repository
Change the URL of the git repo
Temporary Commits
Save modified and staged changes
List stack-order of stashed file changes
Write working from top of stash stack
Discard the changes from top of stash stack
Tracking path Changes
Delete the file from project and stage the removal for commit
Change an existing file path and stage the move
Show all commit logs with indication of any paths that moved
Ignoring Files
/logs/*
# "!" means don't ignore
!logs/.gitkeep
/# Ignore Mac system files
.DS_store
# Ignore node_modules folder
node_modules
# Ignore SASS config files
.sass-cache
A .gitignore file specifies intentionally untracked files that Git should ignore