設定 Git 環境

設定 Git 環境

參考來源: http://progit.org/book/
在這台機器上的預設 git 設定

其實就是設定 ~/.gitconfig 的內容,除了直接編輯外,也可以用指令來設定,例如:

git config --global user.name "yuan wei"
git config --global user.email  yuanwei@XXXX.gmail
git config --global core.editor vim
git config --global merge.tool vimdiff

設定完後,執行 git config –list 應該可以看到如下的內容:

user.name=yuanwei 
user.email=yuanwei@XXXX.gmail 
core.editor=vim
merge.tool=vimdiff

事實上,在 ~/.gitconfig 會長這樣:

[user]
        name = Daniel Lin
        email =  ooo@ooo.ooo.ooo
[core]
        editor = vim
[merge]
        tool = vimdiff

參考別人的設定

這些是別人的 .gitconfig:

[user]
    name = Daniel Lin
    email =  ooo@ooo.ooo.ooo

[core]
    editor = vim

[merge]
    tool = vimdiff

[color]
    diff = auto
    status = auto
    branch = auto
    interactive = auto
    ui = true
    pager = true

[color "branch"]
    current = yellow reverse
    local = yellow
    remote = green

[color "diff"]
    meta = yellow bold
    frag = magenta bold
    old = red bold
    new = green bold

[color "status"]
    added = yellow
    changed = green
    untracked = cyan

[core]
    pager = less -FRSX
    whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol

[alias]
    st = status
    ci = commit
    di = diff
    co = checkout
    w = whatchanged
    lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative

[diff]
    renamelimit = 0

转载于:https://www.cnblogs.com/yuzaipiaofei/archive/2012/05/16/4124203.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值