• git免密推送代码


    create a new repository on the command line

    echo "# proxypool" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https://github.com/xxx/proxypool.git
    git push -u origin master
    
    ##需要输入账号密码
    
    

    push an existing repository from the command line

    git remote add origin https://github.com/xxxx/proxypool.git
    git push -u origin master
    ##需要输入账号密码
    

    githup免密推送

    #创建仓库后获取ssh地址仓库
    Clone with SSH  ----->
    Use a password protected SSH key.  ---->>>>> 获取  git@github.com:xxxx/proxypool.git
    
    
    ##配置本机公钥到github
    ssh-keygen -t rsa -b 4096 -C "uestchan@sina.com"
    
    cat   ~/.ssh/id_rsa.pub   
    复制到github
    操作: 右上角-->>用户-->settings--->SSH and  GPG keys----->new  ssh  keys--->>粘贴即可.
    
    
    
    ##操作使用ssh仓库地址
    git remote -v 有https的即为https方式
    使用 git remote rm origin 命令移除HTTPS的方式
    使用命令 git remote add origin git地址 (git地址是上面复制的内容),使用SSH方式
    使用 git remote -v 命令,再次查看clone的地址,会发现git使用的方式变成了SSH方式
    origin  git@github.com:xxxxxx
    
    
    #################################
    ##1,完整操作流程(首先获取到ssh  仓库地址)
    #################################
    
    
    #################################
    ##2,配置本机公钥到github并测试
    #################################
    ssh -T git@github.com
    Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts.
    Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.
    
    
    
    #################################
    ##3,初始化本地仓库
    #################################
    
    git init
    git add *
    git commit -m "first commit"
    git remote add origin git@github.com:xxxx/proxypool.git
    git push origin master
    
    

    参考:
    https://blog.csdn.net/inthuixiang/article/details/79734245

  • 相关阅读:
    CentOS6.0 yum php mcrypt 扩展安装问题
    WordPress入门系列之基本设置
    ./configure 配置文件时出错checking for g++... no
    锐捷硬件防火墙
    CentOS 安装php mcrypt和mbstring的扩展
    (转)在asp.net 2.0中使用SqlBulkCopy类迁移数据
    正则表达式对象&&String对象
    SQL Server 和 SQLite 时间函数汇总
    FreeBSD下nginx并支持php配置详解
    从Ports安装MySQL
  • 原文地址:https://www.cnblogs.com/g2thend/p/12212813.html
Copyright © 2020-2023  润新知