cygwin配置git

对于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...

转载于:https://www.cnblogs.com/yangzhenlong/p/5547388.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值