使用git的童鞋都知道,git是非常好的版本管理工具,工具再好要想用的得心应手还是要下凡功夫的,比如可以通过对git的全局配置文件.gitconfig进行适当的配置,可以在日常项目开发中节省很多的时间,而且也会让你觉得舒服,下面是本人的.gitconfig全局配置文件,只需要放在用户根目录下不需任何附加操作即可生效(当然要保证你有安装git和git工作目录),当然你可以根据自己喜好来配置alias字段:

[branch]                                                                                                              
    autosetuprebase = always

[user]
    name = xxx

email = xxx

[color]
    ui = true

[alias]
    ad = add
    uad = add -u
    aad = add -A
    iad = add -i

br = branch
    mbr = branch -m
    dbr = branch -d
    rbr = branch -r

bs = bisect
    sbs = bisect start
    gbs = bisect good
    bbs = bisect bad
    lbs = bisect log
    rpbs = bisect replay
    bbco = checkout bisect/bad
    rbs = bisect reset

bm = blame
    lbm = blame -L

cl = clone
    bcl = clone --bare
    mcl = clone --mirror

co = checkout
    bco = checkout -b
    tbco = checkout --track -b

ci = commit
    mci = commit -m
    amci = commit -a -m
    smci = commit -s -m
    cci = commit -C
    scci = commit -s -C
    amci = commit --amend -m
    asmci = commit --amend -s -m
    acci = commit --amend -C
    ascci = commit --amend -s -C
    aemci = commit --allow-empty -m

cp = cherry-pick

cf = cat-file
    pcf = cat-file -p
    tcf = cat-file -t

df = diff
    cdf = diff --cached
    hdf = diff HEAD
    sdf = diff --stat

db = describe
    fp = format-patch

fp = format-patch
    mt = mergetool

ft = fetch
    nft = fetch --no-tags

gcfg = config --global
    egcfg = config --global -e
    ecfg = config -e
   
    lg = log
    glg = log --graph
    olg = log --oneline
    dlg = log --decorate
    rlg = log --raw
    slg = log --stat
    plg = log -p
    polg = log --pretty=oneline
    pflg = log --pretty=fuller
    oglg = log --oneline --graph
    alg = log --pretty=fuller --graph --raw --decorate

lf = ls-files
    slf = ls-files -s

lr = ls-remote
    hlr = ls-remote --heads

mtag = tag -m
    atag = tag -a
    dtag = tag -d
    ttag = tag --tags
    ntag = tag -n1
    tdb = describe --tags
   
    mg = merge
    cmg = merge --continue
    smg = merge --skip
    amg = merge --abort
   
    nr = name-rev
    tnr = name-rev --tags

rb = rebase
    orb = rebase --onto
    irb = rebase -i

rst = reset
    hrst = reset --hard
    srst = reset --soft

rl = reflog

rp = rev-parse
    gd = rev-parse --git-dir
    grd = rev-parse --show-cdup
    brp = rev-parse --symbolic --branches      
    trp = rev-parse --symbolic --tags

rls = rev-list

orls = rev-list --oneline

rt = remote
    art = remote add
    rrt = remote rm
    vrt = remote -v
    surt = remote set-url
    psurt = remote --push set-url
    udrt = remote update   
    rnrt = remote rename

rpull = pull --rebase

ram = am --resolved
    sam = am --skip
    aam = am --abort

st = status
    sst = status -s

sh = show
    ssh = show --stat

sr = show-ref

sfp = format-patch -s

ss = stash
    ass = stash apply
    pss = stash pop
    piss = stash pop --index
    lss = stash list
    css = stash clear
   
[commit]
    template = /home/yuanlu/.gitmsg

git全局配置的更多相关文章

  1. Git 全局配置查看修改

    查看 git config --list git config --global --list 新增 git config --global user.emal=123 删除 git config - ...

  2. GIT·全局配置文件及项目配置文件

    阅文时长 | 0.03分钟 字数统计 | 48.8字符 主要内容 | 1.引言&背景 2.声明与参考资料 『GIT·全局配置文件及项目配置文件』 编写人 | SCscHero 编写时间 | 2 ...

  3. git config 的全局配置

    使用git的全局配置   .gitconfig 一:修改 用户下的.gitconfig 修改如图信息,添加你的信息 二: 命令添加 $ git config --global user.name   ...

  4. Windows系统Git安装配置

    Git的安装 Git是一个开源的分布式的版本控制软件,是Linus Torvalds 为了方便开源贡献者协同开发和管理 Linux 内核开发替代BitKe而开发的. 打开git官网的下载地址:http ...

  5. 一台电脑,两个及多个git账号配置

    1. 生成两[三]个ssh公钥私钥 方法参照:http://www.cnblogs.com/fanbi/p/7772812.html第三步骤 假定其中一个是id_rsa, 另一个时id_rsa_two ...

  6. git 项目配置用户名、邮箱的方法

    git 项目配置用户名.邮箱的方法 单个仓库里,配置用户名.邮箱: git config user.name "姓名" git config user.email "邮箱 ...

  7. git第一节----git config配置

    @查看git的版本 git --version @查看git配置信息 git config --list config list分全局和局部,在根目录下执行git config --list显示为全局 ...

  8. Git 使用配置

    应用情景:使用Git前需要配置 user.name 和 user.email 信息.Git利用这些信息记录谁进行了什么样的操作.Git属于分布式版本管理系统,开发者很多,配置这个就相当于自报家门,告诉 ...

  9. Git安装配置(Linux)

    使用yum安装Git yum install git -y 编译安装 # 安装依赖关系 yum install curl-devel expat-devel gettext-devel openssl ...

随机推荐

  1. OPatch failed with error code 73

    前几天给一套LINUX下的RAC数据库打补丁升级,有一台机器更新失败了,相关的异常内容如下: Restoring "/u01/app/oracle/11.2.0/db_1" to ...

  2. andriod Kernel configuration is invalid

    error:  ERROR: Kernel configuration is invalid.         include/generated/autoconf.h or include/conf ...

  3. 解决sublime text 2总是在新窗口中打开文件

    在mac下不是很喜欢sublime text 2 总是在新窗口中打开文件,很麻烦,文件打多了,就会出现N多窗口,虽然可以直接打开当前目录可以解决,但有时候查看其它项目中的单个文件,就比较麻烦.百度一直 ...

  4. SVN学习

    一.SVN在线安装(Eclipse) 步骤1: 步骤2 其中http://subclipse.tigris.org/update_1.10.x是最新版本的SVN插件的下载站点[subclipse是Ec ...

  5. window对象的属性方法名造成的命名冲突

    事件起因: 一次开发中需要获取一个数组的长度,写下如此代码 function func(arr){ length = arr.length; ......//相关操作 } 程序在chrome下正常运行 ...

  6. 【转】 Android经验: proguard 阻碍 webview 正常工作

    转自:http://blog.csdn.net/span76/article/details/9065941 WebView 常识 使用 Alert  提供消息 我在页面经常用 Alert 提供消息, ...

  7. eclipse 配置git ssh登录

    实现需要安装git的插件,由于我使用的adt和eclipse for javaee版本两个,都已经安装了git插件,就不再演示了,网上都有. 这篇文章主要是介绍使用ssh进行认证的方式. 1.首先,配 ...

  8. NeatUpload 同时选择并上传多个文件

    neatUpload是asp.net 中可以同时上传多个文件的控件,主页:http://neatupload.codeplex.com/. 效果如下图(显示有点不正常...): 使用步骤: 1. 在a ...

  9. 给定一颗二叉搜索树,请找出其中的第k小的结点。例如, 5 / \ 3 7 /\ /\ 2 4 6 8 中,按结点数值大小顺序第三个结点的值为4。

    // ConsoleApplication2.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include "stdafx.h ...

  10. hdu 4869

    一个机智题,可惜比赛的时候没有机智出来 #include<cstdio> #include<cstring> #include<cmath> #include< ...