Location>code7788 >text

Solution to the lag problem of oh-my-bash in git large warehouse

Popularity:145 ℃/2025-02-21 09:59:05

All students who use oh-my-bash know that when CD enters some Git warehouses, oh-my-bash will carefully scan it for you.
Then you get stuck...
(Scrambled in the wind.jpg)

This article tells you a way to turn off git scanning, so that you can have both hands

  1. Modify a theme that does not require git

Find a theme that doesn't have git

cd ~/.oh-my-bash/themes/
 # Check the matching topic (the directory name is the topic)
 ag -v git -l
 # Or use
 grep -rlI -v git ./

For example, use powerline-plain or dos (the display may be a bit problematic) or use minimal

  1. Modify bashrc
vim ~/.bashrc

2.1. Modify the topics found in step 1, such as powerline-plain or dos. I'm using minimal here

OSH_THEME="minimal"

2.2. Slash/Search git, willSCM_GIT_DISABLE_UNTRACKED_DIRTY="true"andSCM_GIT_IGNORE_UNTRACKED="true"Uncomment

  1. Execute the following command in a large warehouse with a stuttering
git config --add -dirty 1
git config --add -status 1

After successful execution
Finally exit and re-enter the terminal or source ~/.bashrc