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/ 如官网下载不 ...
随机推荐
- Remove Element 解答
Question Given an array and a value, remove all instances of that value in place and return the new ...
- Clone使用方法详解【转载】
博客引用地址:Clone使用方法详解 Clone使用方法详解 java“指针” Java语言的一个优点就是取消了指针的概念,但也导致了许多程序员在编程中常常忽略了对象与引用的区别,本文 ...
- http的无状态无连接到底是什么含义
无连接:服务器处理完客户的请求,并收到客户的应答后,即断开连接. 早期这么做的原因是 HTTP协议产生于互联网,因此服务器需要处理同时面向全世界数十万.上百万客户端的网页访问,但每个客户端(即浏览器) ...
- Curvy unity
想获得当前物体在路径的进度 1. 利用CurvySpline.GetNearestPointTF(); 2. 利用CurvyController.RelativePosition;
- 多线程中的lua同步问题
最近写paintsnow::start时出现了一个非常麻烦的BUG,程序的Release版本大约每运行十几次就会有一次启动时崩溃(Debug版本还没崩溃过),崩溃点也不固定.经过简单分析之后,确定是线 ...
- 让man 显示中文
1.添加库函数手册 ubuntu默认是没有安装c语言的库函数man手册的,所以你在man perror 和sendto之类的函数时会显示没有相关文档的问题,这个问题让我郁闷了我好久.解决方法: sud ...
- stagefright框架(三)-选择Video Decode
在<Stagefright (1) – Video Playback的流程>中,我们并没有详述Stagefright是如何根据影片档的类型来选择适合的video decoder,现在,就让 ...
- 【Java基础】foreach循环
从一个小程序说起: class lesson6foreach { public static void main(String[] args) { int array[]={2,3,1,5,4,6}; ...
- JQ 模仿注册时等待的时间
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Convert Sorted List to Binary Search Tree java
public TreeNode sortedListToBST(ListNode head) { if(head==null) return new TreeNode(0); ArrayList< ...