git config --global user.name
"Henry Lee"
git config --global user.email
[email protected]
git clone git://github.com/0ishi/puzzles.git
puzzles
cd
puzzles
# change directory into your local repo.
- (edit files)
- status of your local changes (optional), e.g.
git status
- discard your local changes (optional), e.g.
git checkout .
- put changes to cache (also called index), e.g.
git add src/Puzzles.cs
- get rid of changes out of cache (optional), e.g.
git reset src/puzzles.java
- diff —cached before commit, e.g.
git diff --cached
- commit changes, e.g.
git commit -m 'added Puzzles.cs.'
- push to remote git repo, e.g.
git push [email protected]:0ishi/puzzles.git
- pull from remote git repo (optional), e.g.
git pull
alias gst='git status' # status of changes alias gco='git checkout' # revert changes alias gdf='git diff' # diff of index with HEAD alias gdfcached='git diff --cached' # diff of working and index alias gdfhead='git diff HEAD' # diff of working and HEAD alias gad='git add' # into cache alias gci='git commit' # commit alias grs='git reset' # out of cache alias gps='git push' # push alias gpl='git pull' # pull alias github='cd /Users/henry/github' # on mac osx alias puzzles='cd /Users/henry/github/puzzles' # on mac osx
git config --global color.diff auto git config --global color.status auto git config --global color.branch auto