go into the root of homebrew's repo

cd "$(brew --repo)"

Than replace git remote set-url which from ustc university

git remote set-url origin git://mirrors.ustc.edu.cn/brew.git