Create empty Git repo in specified directory. Run with no arguments
to initialize the current directory as a git repository.
```
git init <directory>
```
Clone repo located at <repo> onto local machine. Original repo can be
located on the local filesystem or on a remote machine via HTTP or SSH.
```
git clone <repo>
```
Define author name to be used for all commits in current repo. Devs
commonly use --global flag to set config options for current user.
```
git config user.name <name>
```
Stage all changes in <directory> for the next commit. Replace <directory> with a <file> to change a specific file.
```
git add <directory>
```
Commit the staged snapshot, but instead of launching a text editor, use <message> as the commit message.
```
git commit -m "<message>"
```
List which files are staged, unstaged, and untracked.
```
git status
```
Display the entire commit history using the default format. For customization see additional options.
```
git log
```
Show unstaged changes between your index and working directory
```
git diff
```
git delete remote tag
```
git push --delete origin tagname
```
git delete local tag
```
git tag --delete tagname
```
git create tag
```
git tag -a vX.Y.Z -m "the message for tag"
```
Define the author name to be used for all commits by the current user
```
git config --global user.name <name>
```
Define the author email to be used for all commits by the current user.
```
git config --global user.email <email>
```
Create shortcut for a Git command. E.g. alias.glog log --graph --oneline will set git glog equivalent to git log --graph --oneline.
```
git config --global alias. <alias-name> <git-command>
```
Set text editor used by commands for all users on the machine. <editor> arg should be the command that launches the desired editor (e.g., vi).
```
git config --system core.editor <editor>
```
Open the global configuration file in a text editor for manual editing.
```
git config --global --edit
```