GIT 经常使用配置

###########################
# 命令行 Network
> git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
###########################
 
###########################
# Git 配置
# 命令行 Network 别名配置
> git config --global alias.lol "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
# 使用方法
> git lol --all
###########################
 
###########################
# 显示A分支的日志,但不包含B分支的提交
> git log branchA ^branchB
# 未合并到master的提交
> git log branchA ^master
###########################
 
###########################
# git 基本配置
> git config --global user.name "mays"
> git config --global user.email "x03570227@gmail.com"
> git config --global color.diff auto
> git config --global color.status auto
> git config --global color.branch auto
# 别名配置
> git config --global alias.st status
> git config --global alias.ci commit
> git config --global alias.df diff
> git config --global alias.co checkout
> git config --global alias.br branch
###########################
 
###########################
# 统一过滤配置
> git config --global core.excludesfile ~/.gitignore
###########################
 
###########################
# 经常使用过滤(.gitignore 文件内容):
*.o
*.lo
*.la
*.al
.libs
*.so
*.so.[0-9]*
*.a
*.pyc
*.pyo
*.rej
*~
.*.swp
.DS_Store
.settings
.project
.classpath
target
bin
*.bak
*.log
.svn
###########################

更新地址:https://gist.github.com/x03570227/5fafed1b7d74b569ca90git

相关文章
相关标签/搜索