悲剧,绝对的悲剧,悲剧中的悲剧。
分类: 项目管理
2016-01-28 19:16:20
Git Setup
I would recommend editing your ~/.gitignore_global file and adding the following lines (to eliminate common system-created files while working in your Git repositories):
*~
.*.swp
.DS_Store
Add the following to your ~/.gitconfig file:
[user]
name =
email =
[color]
ui = true
status = auto
branch = auto
diff = auto
[alias]
co = checkout
ci = commit
cp = cherry-pick
st = status
stat = status
br = branch
hist = log --pretty=format:\"%u %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
dump = cat-file -p
ff = merge --ff-only
rn = log --pretty=format:\"%ad - %s%d\" --date=short
pa = add --patch
These add useful Git command shortcuts, like git st, git ci, and a very useful git hist, which provides Git commit history viewed like (lines shortened to fit in browser):
Also recommend is the Git . You can get the git-completion.bash script from . Once you've installed the completion script, you can make it work by editing your ~/.profile to add:
source ${PATH_TO_SCRIPT}/git-completion.bash
GIT_PROMPT='$(__git_ps1 " [%s]")'
CYAN="\[\033[1;36m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
RESET="\[\033[1;0m\]"
PS1="$CYAN\h$RESET (\W$YELLOW$GIT_PROMPT$RESET)$GREEN\$$RESET "
This will also add a colored shell prompt, with the branch in yellow