代碼是托管到gerrit上的奄侠,本來(lái)用的好好的git pull 結(jié)果在更新完mac os后不能提交了钝吮。對(duì)比Ubuntu依然可以提交藻治。和管理員溝通說(shuō)是無(wú)線的問(wèn)題碘勉,換成有線試試。買(mǎi)了一個(gè)帶網(wǎng)口的轉(zhuǎn)接頭試了試真的可以桩卵,但好景不長(zhǎng)验靡,出現(xiàn)了同樣的問(wèn)題倍宾。
問(wèn)題現(xiàn)象
ssh gerrit-mirror 無(wú)任何的輸出。加上-v之后可以看到ssh走到某一步停了胜嗓。
解決過(guò)程
一. 更新home brew版本高职。
直接home brew 發(fā)現(xiàn)太慢。搜索之后需要換brew源辞州。
1)替換brew.git:
cd "(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
注意:如果 homebrew-core 不存在
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
3)替換homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bashrc
source ~/.bashrc
4)替換homebrew-cask.git:
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
5)brew update
當(dāng)然如果之前沒(méi)有設(shè)置過(guò)brew怔锌,需要安裝一下:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
二.更新ssh
brew install openssh
更新后的版本:
ssh -V
OpenSSH_8.2p1, OpenSSL 1.1.1g 21 Apr 2020
三,解決no matching key exchange method found.
經(jīng)過(guò)一变过,二兩步后就可以ssh gerrit-mirror埃元,但是提交代碼依然報(bào)錯(cuò):
no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
fatal: Could not read from remote repository.
解決辦法,在.ssh/config 文件里添加這兩行媚狰。
Host *
KexAlgorithms +diffie-hellman-group1-sha1