• 【Git】已经在拉取时以HTTP的URL拉取的仓库使用SSH的URL进行push


    添加remote url即可。

    添加前:

    ➜  Linux-for-Newbies git:(main) git remote -v
    origin  https://github.com/ZhaoCake/Linux-for-Newbies.git (fetch)
    origin  https://github.com/ZhaoCake/Linux-for-Newbies.git (push)
    
    • 1
    • 2
    • 3

    添加:

    git remote add --mirror=push ssh_one git@github.com:ZhaoCake/Linux-for-Newbies.git
    
    • 1

    添加后:

    ➜  Linux-for-Newbies git:(main) git push ssh_one
    The authenticity of host 'github.com (20.205.243.166)' can't be established.
    ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
    This key is not known by any other names.
    Are you sure you want to continue connecting (yes/no/[fingerprint])?yyes
    Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
    Enumerating objects: 6, done.
    Counting objects: 100% (6/6), done.
    Delta compression using up to 8 threads
    Compressing objects: 100% (4/4), done.
    Writing objects: 100% (5/5), 2.88 KiB | 46.00 KiB/s, done.
    Total 5 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
    To github.com:ZhaoCake/Linux-for-Newbies.git
       1b13d37..3833b61  main -> main
     * [new reference]   origin/HEAD -> origin/HEAD
     * [new reference]   origin/main -> origin/main
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    如何生成SSH公钥,资料很多,不必分享。

    ssh-keygen -t rsa
    
    • 1
  • 相关阅读:
    c++程序
    Azido-PEG11-amine,1800414-71-4,叠氮-十一聚乙二醇-胺
    Windows进程简介
    查看Mysql数据库版本
    Entity Framework Core 基础 (1)
    基于QT实现的SSL协议的安全报文发送接收设计
    -----指针进阶
    线程池(重点)
    java微信小程序文学小说在线阅读销售网站 uniapp 小程序
    Flask实现注册登录模块
  • 原文地址:https://blog.csdn.net/raw_inputhello/article/details/138175232