$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]
$ git config --list
The git diff command is used when you want to see differences between
any two trees. This could be the difference between your working environment
and your staging area ( git diff
by itself), between your staging area and your
last commit ( git diff --staged
), or between two commits ( git diff master branchB
).
You may want to keep the file on your hard drive but not have Git track it anymore. This is particularly useful if you forgot to add something to your .gitignore file and accidentally staged it, like a large log file or a bunch of .a compiled files. To do this, use the --cached option:
$ git rm --cached README
$ git config --global alias.co checkout
$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.st status
$ git config --global alias.unstage "reset HEAD --"
$ git config --global alias.last "log -1 HEAD"