$ git config --global user.name ben
$ git config --global user.email [email protected]
$ git config --global core.editor mate
$ git config --global merge.tool mate
$ git config --global color.diff auto
$ git config --global color.status auto
$ git config --global color.branch auto
initializing a repository in an existing directory
$ git clone <url>
$ git clone git://github.com/schacon/grit.git
$ git clone git://github.com/schacon/grit.git mygrit
checking the status of files
- add or update all file under the directory
- add or update all file end with .c
- add or update index.php and register.php
$ add index.php register.php
commit staging files to local repo
- commit files with description "blah"
remove file from repo and directory
$ git rm --cached <file name>
$ git mv <old_file> <new_file>
compare working tree with staging area
compare staging area with repo.
compare working tree with repo.
reset files from staging area to untagging or untracked
$ git reset HEAD <file name>
reset files from unstaging to original status ( as pull from repo )
$ git checkout <file name>
$ git tag -a v1.0.0 -m "Creating the first official version."
$ git tag -a v1.2 7c5f24d
$ git push origin :refs/tags/v1.0.0
$ git rebase -i <commit number>