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
總結
以上是生活随笔為你收集整理的cygwin配置git的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jQuery on 绑定的事件触发多次
- 下一篇: SCI/EI期刊投稿 Reply Let