git常用配置及别名设置
2015-11-10 17:29
176 查看
三个不同的位置:
常用配置及别名习惯:
1./etc/gitconfig 文件:包含了适用于系统所有用户和所有库的值。如果你传递参数选项’--system’ 给 git config,它将明确的读和写这个文件。 2.~/.gitconfig 文件 :具体到你的用户。你可以通过传递--global 选项使Git 读或写这个特定的文件。 3.位于git目录的config文件 (也就是 .git/config) :无论你当前在用的库是什么,特定指向该单一的库。每个级别重写前一个级别的值。因此,在.git/config中的值覆盖了在/etc/gitconfig中的同一个值。
常用配置及别名习惯:
[core] editor = vim whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol excludesfile = /Users/andy/.gitignore_global # 提交时, 不允许混合不同的换行符 safecrlf = true # 检出和提交时, 都不自动转换换行符 autocrlf = false [web] browser = google-chrome [rerere] enabled = 1 autoupdate = 1 [alias] s = status st = status sb = status -s -b ############# d = diff di = diff dc = diff --cached dk = diff --check dck = diff --cached --check ############# c = commit ca = commit -a cm = commit -m ci = commit ############# l = log --oneline lg = log --oneline --graph --decorate ############# o = checkout co = checkout ob = checkout -b cob = checkout -b ############# b = branch bv = branch -vv ba = branch -a bd = branch -d br = branch -r ############# f = fetch fo = fetch origin ############# m = merge ############# ps = push pl = pull pb = pull --rebase psf = push -f psu = push -u plu = pull -u pso = push origin plo = pull origin pbo = pull --rebase origin psfo = push -f origin psuo = push -u origin pluo = pull -u origin ############# rb = rebase ############# re = reset rh = reset HEAD reh = reset --hard rem = reset --mixed res = reset --soft rehh = reset --hard HEAD remh = reset --mixed HEAD resh = reset --soft HEAD ############# w = show ############# human = name-rev --name-only --refs=refs/heads/* [color] ui = true [color "branch"] current = yellow bold local = green bold remote = cyan bold [color "diff"] meta = yellow bold frag = magenta bold old = red bold new = green bold whitespace = red reverse [color "status"] added = green bold changed = yellow bold untracked = red bold [push] default = upstream [difftool "sourcetree"] cmd = opendiff \"$LOCAL\" \"$REMOTE\" path = [mergetool "sourcetree"] cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" trustExitCode = true [filter "media"] required = true clean = git media clean %f smudge = git media smudge %f [filter "hawser"] clean = git hawser clean %f smudge = git hawser smudge %f required = true
相关文章推荐
- 数据挖掘3---决策树的构造
- Android消息通信 第三方开源项目EventBus 的用法
- ImmediateFunc.js
- domOperation.js
- coffee.js
- property标签区分字符串和OGNL表达式
- svn安装
- ProgressBar进度条控件
- Dapper的使用
- Android Fragment 真正的完全解析(上)
- Android——实用小技巧
- callback.js
- HLSL编译工具—FXC
- Apache下htaccess有关301重定向、404错误的设置
- Outlook客户端无法发送附件,频繁与Exchange服务器断开现象解决方案
- 所有重复都适用的去重方法
- 如何启动公司内部的devops运动--尤其是后端开发人员&运维
- c++程序的内存格局
- python 模块学习
- array.js