在git操作中有很多命令我们自己可以起别名,以提高操作效率。

1. 配置方式

1)项目级别的配置,仅对当前项目生效(将写入到.git/config文件中)
    $ git config --global alias.st status

2)用户级别的配置(使用--global (将写入到~/.gitconfig中)
    $ git config --global alias.st status
    $ git config --global alias.co checkout

3)系统级别的配置(使用--system)对整个系统生效
    $ git config --system  对整个系统生效

2. 常用设置

  1. $ git config --global color.ui auto
  2. $ git config --global user.name "test"
  3. $ git config --global user.email "test@sina.com"
  4. $ git config --global color.ui auto
  5.  
  6. $ git config --global alias.st status
  7. $ git config --global alias.co checkout
  8. $ git config --global alias.ci commit
  9. $ git config --global alias.br branch
  10.  
  11. $ git config --global alias.ps push
  12. $ git config --global alias.pl pull
  13.  
  14. $ git config --global alias.unstage 'reset HEAD'
  15.  
  16. $ git config --global alias.last 'log -1'
  17. $ git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
  18. $ git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

3. 其他命令

  查看设置的别名  git config --list | grep alias

  取消别名设置  git config --global --unset alias.st

git 之别名配置的更多相关文章

  1. git取别名配置

    已经配置的别名 $ git config --global alias.st status $ git config --global alias.co checkout $ git config - ...

  2. Git 基础 —— 安装 配置 别名 对象

    Git 基础学习系列 Git 基础 -- 安装 配置 别名 对象 Git 基础 -- 常用命令 Git 基础 -- 常见使用场景 Git基础 -- Github 的使用 Git 安装 Git下载地址 ...

  3. Mac上git的安装配置与使用简述

    Mac下git搭建及使用 之前就只是经常在GitHubs上下载代码,也没注意怎么上传项目.一开始对git都没什么了解花了几个小时去小补了下知识.如果有需要可以转去这里学习:[GIT使用简易指南] (h ...

  4. g4e基础篇#3 Git安装与配置

    g4e 是 Git for Enterprise Developer的简写,这个系列文章会统一使用g4e作为标识,便于大家查看和搜索. 章节目录 前言 1. 基础篇: 为什么要使用版本控制系统 Git ...

  5. git命令别名(Alias)

    每次切换分支: git ckeckout branch_name 等命令费时又费力,git 别名配置起来: 别名配置: git config --global alias.ck ckeckout 其他 ...

  6. 【亲测可用,亦可配置同一平台的不同账号,例如阿里云的两个不同账号】Windows下Git多账号配置,同一电脑多个ssh-key的管理

    Windows下Git多账号配置,同一电脑多个ssh-key的管理   这一篇文章是对上一篇文章<Git-TortoiseGit完整配置流程>的拓展,所以需要对上一篇文章有所了解,当然直接 ...

  7. 第一讲:Git分区,配置与日志

    前言 曾经听到过这样一句话:不会git就不要敲代码了.细细品味确实有其中的道理,可能是当事人代码被强行覆盖后的叹息吧! 因此,为了避免这种情况,接下来我们就一起来好好学习git的相关知识吧!不怕你不会 ...

  8. Win7上Git安装及配置过程

    Win7上Git安装及配置过程 文档名称 Win7上Git安装及配置过程 创建时间 2012/8/20 修改时间 2012/8/20 创建人 Baifx 简介(收获) 1.在win7上安装msysgi ...

  9. Windows系统中Git的安装配置

    一.Git安装 1.下载 Git官网:https://git-scm.com/download/ 选择windows版本下载即可. 百度软件中心:http://rj.baidu.com/ 如官网下载不 ...

随机推荐

  1. Structs2中Action返回json到前台方法

    1.传统方式JSON输出 这一点跟传统的Servlet的处理方式基本上一模一样,代码如下 01 public void doAction() throws IOException{ 02        ...

  2. UESTC_韩爷的情书 2015 UESTC Training for Graph Theory<Problem H>

    H - 韩爷的情书 Time Limit: 6000/2000MS (Java/Others)     Memory Limit: 262144/262144KB (Java/Others) Subm ...

  3. IOS Application生命周期

    第一阶段 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *) ...

  4. sqlplus常用操作命令2

    常用编辑命令:A[ppend] text 将text附加到当前行之后C[hange] /old /new 将当前行中的old替换为newCLear] buff[er] 清除缓冲区中的所有行DEL 删除 ...

  5. idea maven 无法加载已经安装的模块

    新建了一下maven项目,下面新建了一个模块,某一个模块clean install之后,别的模块虽然使用dependency标签引入了,但是仍然无法使用, 这个时候,应该重新建立一个项目,将原有项目的 ...

  6. transform的2D部分,嗯…就这个标题了。

    上一次写了transition的内容,这次就写拼写很类似的另外一个属性transform好了……我英语差这件事就不要吐槽了,下面是正文,真的: transition是过渡,transform是变换. ...

  7. cc1plus: fatal error: emeralddb-pmdMain.d: No such file or directory

    签名autoscan, aclocal, config啥的都没错,最后make 报下面的错,查了各个文件没发现有啥问题,请哪位帮忙卡看 make[1]: Entering directory `/ro ...

  8. 部署sharepointform验证

    1  iis sharepoint v4 提供程序2  web service 验证提供程序3 创建web应用程序(选择基于身份验证模式,配置提供程序)4 创建网站集(空)5 创建网站集

  9. java中拼接两个数组

    int a[]={1,2,3,2}; int b[]={4,2,90,8,98}; int[] d3 = new int[a.length + b.length]; System.arraycopy( ...

  10. Mac系统杂项 (持续更新)

    一.调整LaunchPad的图标显示列数和行数 .调整每一列显示图标数量.在我的电脑上(1366 * 768),每列7个个人觉得比较不错 defaults write com.apple.dock s ...