ubuntu日常

Ubuntu配置Git

2018-02-25  本文已影响181人  吴意外
  1. 安装Git
    1. sudo apt-get install git
  2. 配置git信息
    1. git config --global user.name "Your Name"
    2. git config --global user.email "email@example.com"
    3. git config --list 查看设置
  3. 配置ssh
    1. ssh-keygen -t rsa -C "youremail@example.com"
  4. 会看到有id_rsa(私钥),id_rsa.pub(公钥) 拷贝公钥
  5. 在自己的github上添加公钥,add key.
  6. 以后提交代码就不用输入账号密码了。
  7. 如果添加公钥依然无效
    1. 打开项目目录下隐藏的文件夹.git
    2. 找到config文件
    3. 把项目url从http方式改成ssh方式
上一篇 下一篇

猜你喜欢

热点阅读