在这个文件下增加下面的语句
1.编辑这个配置文件
gedit ~/.bashrc &
2.增加的语句
function git_branch {
branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`"
if [ "${branch}" != "" ];then
if [ "${branch}" = "(no branch)" ];then
branch="(`git rev-parse --short HEAD`...)"
fi
echo " [*$branch]"
fi
}
export PS1='\[\033[01;32m\]\@ \[\033[01;33m\]\w\[\033[01;31m\]$(git_branch)\[\033[01;37m\]\n\u \$ '
export CCACHE_EXEC=/usr/bin/ccache
export USE_CCACHE=true
export CCACHE_SLOPPINESS=file_macro,include_file_mtime,time_macros
export CCACHE_UMASK=002
export CCACHE_DIR=/media/root/2.0T_pro/project_ssd/ccache
if [[ $- == *i* ]]
then
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
fi
function git_branch {
branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`"
if [ "${branch}" != "" ];then
if [ "${branch}" = "(no branch)" ];then
branch="(`git rev-parse --short HEAD`...)"
fi
echo " [*$branch]"
fi
}
export PS1='\[\033[01;32m\]\@ \[\033[01;33m\]\w\[\033[01;31m\]$(git_branch)\[\033[01;37m\]\n\u \$ '
if [[ $- == *i* ]]
then
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
fi
export PATH=$PATH:/mnt/d/adb/adb
alias adb='/mnt/d/adb/adb/adb.exe'
export PATH=$PATH:/mnt/d/adb/adb
alias fastboot='/mnt/d/adb/adb/fastboot.exe'
3.让文件生效
source ~/.bashrc