美文网首页
Git 的相关配置文件

Git 的相关配置文件

作者: 蚍蜉showtime | 来源:发表于2018-11-24 18:41 被阅读0次

    一、配置别名

    1.通过配置主目录配置文件:

    • 编辑用户主目录下的隐藏文件 .gitconfig 文件,编辑举例如下:
    [user]
        name = yourname
        email = yourname@email.com
    [color]
        ui = true
        diff = true
        status = true
        branch = true
        interactive = true
    [alias]    //配置别名
        st = status
        ss = status -s
        ci = commit
        ca = commit --amend
        co = checkout
        ll = log --graph --color --format=format:'%C(bold)%h%C(reset) -%C(bold)%d%C(reset) %C(white)%s%C(reset) %C(bold red)- %an' --abbrev-commit
        ft = fetch
        pl = pull --rebase
        br = branch
        cp = cherry-pick
        mg = merge
        rb = rebase
        dci = dcommit
        sbu = submodule update 
    

    2.通过命令

    • git config --global alias.st status,也很简单,每一条对应的是.gitconfig中的一个项
    • git config alias.st status,这样修改的是项目文件中的.git/config文件。

    相关文章

      网友评论

          本文标题:Git 的相关配置文件

          本文链接:https://www.haomeiwen.com/subject/tucsqqtx.html