zoukankan      html  css  js  c++  java
  • 設定 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
  • 相关阅读:
    Springboot学习:核心配置文件
    Springboot学习:底层依赖与自动配置的原理
    Springboot学习:介绍与HelloWorld
    js根据时间戳倒计时
    windows phone 豆瓣api的封装
    Android开发初始
    PHP(一)
    程序员修炼之道(一)
    WebClient和HttpReuqest两种网络请求的方式
    黑客与画家(二)
  • 原文地址:https://www.cnblogs.com/yuzaipiaofei/p/4124203.html
Copyright © 2011-2022 走看看