Skip to content

overlakehome/puzzles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

to jumpstart this puzzles git repo into a local repo of your choices.

  1. git config --global user.name "Henry Lee"
  2. git config --global user.email [email protected]
  3. git clone git://github.com/0ishi/puzzles.git puzzles
  4. cd puzzles # change directory into your local repo.

to get to normal workflow of edit, revert, cache, commit, and push to remote.

  1. (edit files)
  2. status of your local changes (optional), e.g. git status
  3. discard your local changes (optional), e.g. git checkout .
  4. put changes to cache (also called index), e.g. git add src/Puzzles.cs
  5. get rid of changes out of cache (optional), e.g. git reset src/puzzles.java
  6. diff —cached before commit, e.g. git diff --cached
  7. commit changes from cache, e.g. git commit -m 'added Puzzles.cs.'
  8. push to remote git repo, e.g. git push [email protected]:0ishi/puzzles.git
  9. pull from remote git repo (optional), e.g. git pull
  10. merge conflicting changes (optional), e.g. git mergetool

to shortcut most common git commands using your favorite shell aliases.

alias gst='git status' # status of changes
alias gco='git checkout' # revert changes
alias gdf='git diff' # changes in the working tree not yet staged for the next commit.
alias gdfcached='git diff --cached' # Changes between the staged index and the last commit.
alias gdfhead='git diff HEAD' # changes in the working tree since the last commit.
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

to produce colorful output with git commands.

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

to configure p4merge & p4diff, ~/.gitconfig (git config file) needs these lines:

[merge]
    keepBackup = false;
    tool = p4merge
[mergetool "p4merge"]
    cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
    keepTemporaries = false
    trustExitCode = false
    keepBackup = false
[diff]
    external = p4diff

resources

윈도우즈에서 Git-1.7.×.x-exe (데스크탑 용) 설치
윈도우즈에서 Git 사용 가이드