ssh升级后连接gitlab失败

  • 查看前后版本
    • 升级之前版本
      ssh -V OpenSSH_7.6p1, LibreSSL 2.6.2
    • 升级之后版本
      ssh -V OpenSSH_9.0p1, LibreSSL 3.3.6
  • 原因
    • OpenSSH的版本升级到8.8之后默认屏蔽了rsa算法,需要显示配置启用
  • 处理 “~/.ssh/config”中添加
    如果不存在就创建一个
    1
    2
    3
    4
    # all
    Host *
    PubkeyAcceptedKeyTypes +ssh-rsa

    brew问题处理

一键重装更换源自动

  • 用这个最有效
    1
    /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

打印当前的源

cd “$(brew –repo)”
git remote -v
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote -v

切换为官方原始源

cd “$(brew –repo)”
git remote set-url origin https://github.com/Homebrew/brew.git
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
brew update

切换为清华源

详情请参考:https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

cd “$(brew –repo)”
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git pull
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git pull
brew update

切换腾讯源

官网列表:https://mirrors.cloud.tencent.com/

cd “$(brew –repo)”
git remote set-url origin https://mirrors.cloud.tencent.com/homebrew/brew.git
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.cloud.tencent.com/homebrew/homebrew-core.git
brew update

切换阿里源

cd “$(brew –repo)”
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
brew update

php安装

安装

1
2
3
4
5
brew tap shivammathur/php
brew install shivammathur/php/php@7.4
brew link php@7.4


参考:https://phpstone.com/wiki/macOS.html

错误解决

  • 报错
    fatal: not in a git directory
    Error: Command failed with exit 128: git

  • 解决

1
2
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask