zoukankan      html  css  js  c++  java
  • git 上配置公钥

    1、在自己的linux服务器上执行

    ssh-keygen -t rsa -b 2048 -C "admin@qq.com"

    2、此时生成了公钥和秘钥,可以查看一下

    ls ~/.ssh/

    3、复制我们的公钥

    cat id_rsa.pub

    4、在gitee.com上添加公钥

    直接把公钥粘贴进去即可

    5、拉git上的项目

    cd /mnt/www/yan

    git config --global user.name "xxxx"

    git config --global user.email "admin@qq.com"

    git init

    git remote add origin git地址   //注意是ssh的地址

    git pull origin master  //拉项目  ,你会发现不需要你输入密码

    6、配置一个快捷方式来拉项目

    vi ~/.bash_profile

    然后编辑

    alias yan='cd /mnt/www/yan/ && git checkout master && git pull origin master'

    保存退出

    执行:source ~/.bash_profile 使其立即生效

    ok所以的就做好了,以后只需要打开服务器,执行yan命领就可以在服务器上拉项目了

  • 相关阅读:
    PHP中的NULL类型
    js中自定义事件,使用了jQuery
    chrome调试文章
    codeforces 633D
    hdu 1496 Equations
    poj 1286 Necklace of Beads
    poj 2154 Color
    poj 3270 Cow Sorting
    poj 1026 Cipher
    poj 2369 Permutations
  • 原文地址:https://www.cnblogs.com/paokaiyiqie/p/8512045.html
Copyright © 2011-2022 走看看