码迷,mamicode.com
首页 > Windows程序 > 详细

cygwin配置git

时间:2016-05-31 22:09:47      阅读:466      评论:0      收藏:0      [点我收藏+]

标签:

对于windows用户来说,使用git bash经常会出现乱码情况,那么一款优质高尚的软件,值得推荐一下了,那就是cygwin

下载cygwin后,在安装过程中,安装git,安装vim编辑器

然后会在安装目录下看到类linux目录结构:

技术分享

配置别名alias:

打开vim /etc/bash.bashrc,添加:

#自定义ls颜色

alias grep=‘grep --color‘ # show differences in colour
alias ls=‘ls -hF --color=tty --show-control-chars‘ # classify files in colour
alias dir=‘ls --color=auto --format=vertical --show-control-chars‘
alias vdir=‘ls --color=auto --format=long --show-control-chars‘
alias ll=‘ls -la --show-control-chars‘ # long list
alias la=‘ls -A --show-control-chars‘ # all but . and ..
alias l=‘ls -lF --show-control-chars‘
## 添加清屏处理
alias clear=‘clearn‘

 

配置git设置:

打开 vim ~/.gitconfig,添加:

[user]
name = #your name#
emali = #your email# 

[color]
ui = true

[alias]

co = checkout
br = branch

lg = log --color --graph --pretty=format:‘%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset‘ --abbrev-commit

 

配置上传时忽略文件类型:

vim ~/.gitignore,添加

/bin/
/work/
/.gitignore
.idea
oskey
oskey.pub
*/*.iml
target
target/*
afbx.iml
.git-credentials
*/.classpath
*/.settings/*
*/.project

 

好了,保存,关闭cygwin后重新打开,切换到git项目目录

发现ls后可以显示各种颜色,再看git lg

技术分享

 

git lg -p:查看详细修改

技术分享

 

the end...

cygwin配置git

标签:

原文地址:http://www.cnblogs.com/yzlpersonal/p/5547388.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!