git 之别名配置
在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. 常用设置
$ git config --global color.ui auto
$ git config --global user.name "test"
$ git config --global user.email "test@sina.com"
$ git config --global color.ui auto $ git config --global alias.st status
$ git config --global alias.co checkout
$ git config --global alias.ci commit
$ git config --global alias.br branch $ git config --global alias.ps push
$ git config --global alias.pl pull $ git config --global alias.unstage 'reset HEAD' $ git config --global alias.last 'log -1'
$ 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"
$ 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 之别名配置的更多相关文章
- git取别名配置
已经配置的别名 $ git config --global alias.st status $ git config --global alias.co checkout $ git config - ...
- Git 基础 —— 安装 配置 别名 对象
Git 基础学习系列 Git 基础 -- 安装 配置 别名 对象 Git 基础 -- 常用命令 Git 基础 -- 常见使用场景 Git基础 -- Github 的使用 Git 安装 Git下载地址 ...
- Mac上git的安装配置与使用简述
Mac下git搭建及使用 之前就只是经常在GitHubs上下载代码,也没注意怎么上传项目.一开始对git都没什么了解花了几个小时去小补了下知识.如果有需要可以转去这里学习:[GIT使用简易指南] (h ...
- g4e基础篇#3 Git安装与配置
g4e 是 Git for Enterprise Developer的简写,这个系列文章会统一使用g4e作为标识,便于大家查看和搜索. 章节目录 前言 1. 基础篇: 为什么要使用版本控制系统 Git ...
- git命令别名(Alias)
每次切换分支: git ckeckout branch_name 等命令费时又费力,git 别名配置起来: 别名配置: git config --global alias.ck ckeckout 其他 ...
- 【亲测可用,亦可配置同一平台的不同账号,例如阿里云的两个不同账号】Windows下Git多账号配置,同一电脑多个ssh-key的管理
Windows下Git多账号配置,同一电脑多个ssh-key的管理 这一篇文章是对上一篇文章<Git-TortoiseGit完整配置流程>的拓展,所以需要对上一篇文章有所了解,当然直接 ...
- 第一讲:Git分区,配置与日志
前言 曾经听到过这样一句话:不会git就不要敲代码了.细细品味确实有其中的道理,可能是当事人代码被强行覆盖后的叹息吧! 因此,为了避免这种情况,接下来我们就一起来好好学习git的相关知识吧!不怕你不会 ...
- Win7上Git安装及配置过程
Win7上Git安装及配置过程 文档名称 Win7上Git安装及配置过程 创建时间 2012/8/20 修改时间 2012/8/20 创建人 Baifx 简介(收获) 1.在win7上安装msysgi ...
- Windows系统中Git的安装配置
一.Git安装 1.下载 Git官网:https://git-scm.com/download/ 选择windows版本下载即可. 百度软件中心:http://rj.baidu.com/ 如官网下载不 ...
随机推荐
- STL中map与hash_map容器的选择收藏
这篇文章来自我今天碰到的一个问题,一个朋友问我使用map和hash_map的效率问题,虽然我也了解一些,但是我不敢直接告诉朋友,因为我怕我说错了,通过我查询一些帖子,我这里做一个总结!内容分别来自al ...
- 基于引擎的matlab+vc混合编程的配置
前段时间在项目中做了一些关于基于引擎的vc+matlab混合编程的工作. 如果你是混合编程新手,我相信使用引擎的方式编程是比较简单快捷的一种方式. 当然这种方法也有其缺点,就是不能脱离matlab运行 ...
- HTML5 Canvas绘图系列之一:圆弧等基础图形的实现
之前的一个微信项目已经要结项了,最近整理一下项目中使用较多的canvas画图方面的知识吧,打算写个3,4篇的样子.本篇主要介绍基础操作和弧线画法. 之后再写一下趋势图,直方图,文本图像处理的. 言归正 ...
- Can you find it?(二分 二分+STL set map)
Can you find it? Time Limit : 10000/3000ms (Java/Other) Memory Limit : 32768/10000K (Java/Other) T ...
- 最逼近Mac OS的Linux系统 -- Elementary OS
也不知道有多少人听说过Elementary OS?elementary Project 最开始只有一个 elementary 主题,之后延伸出了很多项目,形成了 elementary Project ...
- 具体解释EBS接口开发之物料导入API
create_item inv_item_grp.create_item(p_commit => fnd_api.g_true, -- p_item_rec => l_item_rec, ...
- AIX-vi操作-提示Unknown terminal type的问题解决方法
AIX-vi操作-提示Unknown terminal type的问题解决方法AIX Version 5.3$ vi /etc/profilelinux: Unknown terminal type[ ...
- top命令的解释
top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器.下面详细介绍它的使用方法. top - 01:06:48 up 1:22, ...
- RFC端口号定义
RFC关于计算机端口号定义 http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers. ...
- NSNumber 和 NSValue 的部分使用
1.NSNumber 在Objective-c中有int,float,char等基本数据类型,但这些基本数据类型并不是对象,而数组,字典,字符串等容器中存放的都是对象类型,因此我们需要用到NSNumb ...