I have a VPS with CentOS system. The system has a high loadavg in normal time.
I have a Git directory which is very large (nearly 800 MB). When I type command cd
to the directory, it takes so long time of the shell to respond.
What happen when I type cd
to the Git directory? What can I do to optimize the enter time?
Add my Bash profile here:
This is my .bash_profile
file:
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\u@\h:\w\[\e[1;36m\]$(parse_git_branch)\[\e[0m\]$ '