• git操作汇总


    1. 创建SSH Key:ssh-keygen -t rsa -C "myemail@gmail.com",设置
    2. Enter file in which to save the key
    3. Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): /c/Users/Administrator/.ssh/github_id_rsa
      Enter passphrase (empty for no passphrase):
      Enter same passphrase again:
      Your identification has been saved in /c/Users/Administrator/.ssh/github_id_rsa.
      Your public key has been saved in /c/Users/Administrator/.ssh/github_id_rsa.pub.

       多个账号添加私钥

      Administrator@STFCB MINGW64 /d/erp_git
      $ ssh-add ~/.ssh/id_rsa_github
      /c/Users/Administrator/.ssh/id_rsa_github: No such file or directory
      
      Administrator@STFCB MINGW64 /d/erp_git
      $ ssh-add ~/.ssh/github_id_rsa
      Enter passphrase for /c/Users/Administrator/.ssh/github_id_rsa:
      Identity added: /c/Users/Administrator/.ssh/github_id_rsa (/c/Users/Administrator/.ssh/github_id_rsa)
      
      Administrator@STFCB MINGW64 /d/erp_git
      $ ssh-add.exe -l
      2048 SHA256:4trwpMcUMBNYiQinproDZmr6B0g5mFnRJSEZ+xkGM+0 /c/Users/Administrator/.ssh/id_rsa (RSA)
      2048 SHA256:/W1ALrdS/OEf7XRHSfhs7QCoEuBbNkP2k3RTeN7JPVo /c/Users/Administrator/.ssh/github_id_rsa (RSA)

      多个账号需要配置config文件 

      # 该配置用于工作  
      # Host 服务器别名  
      Host code.aliyun.com  
      # HostName 服务器ip地址或机器名  
      HostName code.aliyun.com 
      # User连接服务器的用户名  
      User soft****@163.com  
      # IdentityFile 密匙文件的具体路径  
      IdentityFile C:/Users/Administrator/.ssh/id_rsa  
        
        
      # 该配置用于个人 github 上  
      # Host 服务器别名  
      Host github.com  
      # HostName 服务器ip地址或机器名  
      HostName github.com  
      # User连接服务器的用户名  
      User soft****@gmial.com  
      # IdentityFile 密匙文件的具体路径  
      IdentityFile C:/Users/Administrator/.ssh/id_rsa_github
    4. C:UsersAdministrator.ssh下的id_rsa、id_rsa.pub两个文件
    5. 登陆到code网站,添加New SSH Key,id_rsa.pub添加到输入框中
    6. git init//初始化
    7. git clone git@code.aliyun.com:softfuwus/dev.git//克隆git
    8. git add .//添加
    9. git commit -m "init"//提交
    10. git push -u origin master//push到git
    11. echo "# dev" >> README.md
      git init
      git add README.md
      git commit -m "first commit"
      git remote add origin git@github.com:xgrowingpain/dev.git
      git push -u origin master
      

        

  • 相关阅读:
    程序化广告交易中的点击率预估
    C++(三十七) — 字符串的函数重载—案例
    C++(三十六) — 等号操作符重载、&&,||不可重载
    C++(三十五) — 运算符重载
    C++(三十四) — 友元函数、友元类
    C++(三十三) — 全局函数、成员函数的区别
    C++(三十二) — 常对象、常成员变量、常成员函数
    C++(三十一) — 静态成员变量、静态成员函数
    C++(三十) — this 指针
    C++(二十九) — new 和 delete
  • 原文地址:https://www.cnblogs.com/growingpains/p/7267039.html
Copyright © 2020-2023  润新知