Last active
December 27, 2017 18:22
-
-
Save xhlwill/688c92d8a6026085fffe4ab6c97855ae to your computer and use it in GitHub Desktop.
修改 .bash_profile(mac) 或 .bashrc(linux) 让 terminal 能自动补全 git 命令、显示 git 分支等信息 (git-completion.bash 和 git-prompt.sh 放入 ~ 目录)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/git-completion.bash | |
source ~/git-prompt.sh | |
export GIT_PS1_SHOWDIRTYSTATE="true" | |
export GIT_PS1_SHOWSTASHSTATE="true" | |
export GIT_PS1_SHOWUNTRACKEDFILES="true" | |
export GIT_PS1_SHOWUPSTREAM="auto" | |
export GIT_PS1_SHOWCOLORHINTS="true" | |
green=$'\e[0;32m' | |
magenta=$'\e[0;35m' | |
yellow=$'\e[0;33m' | |
normal_colours=$'\e[m' | |
PS1='\[$green\]\u@\h:\W\[$magenta\]$(__git_ps1 " (%s)")\[$yellow\]\$\[$normal_colours\] ' | |
alias ls='ls -G' | |
alias ll='ls -alG' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you ,it's useful