git 基本配置

配置user.name 和 user.email

git config --global user.name 'sam'
git config --global user.email '[email protected]'

config的三个作用域,其中省略等同于local

  • git config --local 只对某个仓库有效
  • git config --global 对当前用户所有仓库有效
  • git config --system 对系统所有登录的用户有效

显示config的配置,加--list

  • git config --list --local
  • git config --list --global
  • git config --list --system

mac公钥

  • 生成
ssh-keygen -t rsa
  • 获取现有公钥
cat ~/.ssh/id_rsa.pub
  • 复制
cp ~/.ssh/id_rsa.pub + 相应路径

你可能感兴趣的:(git 基本配置)