Jerry's WIKIJerry's WIKI
Overview
  • 🐞 Web
  • 📐 Components
  • 💡 Skills
  • 🎱 Specification
  • đŸ–Ĩ Workflows
  • 🛠 Tools
  • đŸŒī¸ Linux
  • đŸ“Ļ Container
  • â™¨ī¸ Language
Coffee
  • įŽ€äŊ“中文
  • English
GitHub
Overview
  • 🐞 Web
  • 📐 Components
  • 💡 Skills
  • 🎱 Specification
  • đŸ–Ĩ Workflows
  • 🛠 Tools
  • đŸŒī¸ Linux
  • đŸ“Ļ Container
  • â™¨ī¸ Language
Coffee
  • įŽ€äŊ“中文
  • English
GitHub
  • 🚩 Version Control (Git)

    • Key Configuration and Usage
    • Multi-platform and Multi-repository Key Management
    • Collaborative Development
    • Common Scenarios and Solutions
    • Others
  • âœī¸ Editor (Idea)

    • Shortcut Key Modification
    • VCS Operations
    • Others
  • 🎁 Debugging Tools

    • Stress Testing Tools
    • API Testing
    • Packet Sniffing Tools
  • 🔭 Client

    • Navicat
    • Mredis
    • Docker Desktop
  • 🍎 Mac Tools

    • Brew
    • Iterm2
  • 🌈 Miscellaneous

    • List

Multi-Platform and Multi-Repository Usage

Index

    Scenario

    Your personal project and the company project may not be on the same hosting platform, but you need to develop on a single machine.


    1. Create key pairs for different hosting platforms.
    ssh-keygen -t ed25519 -C "JerryTZF@github.com" -f ~/.ssh/id_github
    ssh-keygen -t ed25519 -C "JerryTZF@gitlab.com" -f ~/.ssh/id_gitlab
    ssh-keygen -t ed25519 -C "JerryTZF@gitee.com" -f ~/.ssh/id_gitee
    
    1. Add private keys of different platforms to the ssh-agent
    ssh-add ~/.ssh/id_github
    ssh-add ~/.ssh/id_gitlab
    ssh-add ~/.ssh/id_gitee
    
    1. Write the configuration file
    vim ~/.ssh/config
    
    # company
    Host gitee.com
    HostName gitee.com
    User JerryTZF
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_company
    
    # myself
    Host github.com
    HostName github.com
    User JerryTZF
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_myself
    
    1. Test
    ssh -T git@github.com
    ssh -T git@gitee.com
    
    Edit this page
    Update At:
    Contributor: į”°æœå¸†
    Prev
    Key Configuration and Usage
    Next
    Collaborative Development