Ubuntu配置Git

作者: 吴意外 | 来源:发表于2018-02-25 01:17 被阅读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方式

相关文章

网友评论

    本文标题:Ubuntu配置Git

    本文链接:https://www.haomeiwen.com/subject/dfdhxftx.html