对单一仓库配置小号以远程管理小号仓库

命令行操作

  • 给这个仓库单独设置小号(仅本地生效)

    1
    2
    git config --local user.name "ru-sin"
    git config --local user.email "i@rusin.cnt"
  • 把远程地址绑定到小号仓库

    1
    git remote set-url origin https://ru-sin@github.com/ru-sin/gugo.git
  • 推送(第一次会让你登录小号)

    1
    git push -f origin main

登录时怎么填?

弹出窗口时:
使用 SSH 登录

在输入框中填入在 这里 创建的 SSH 密钥(权限建议仅 Repo)。


最终效果(最舒服的状态)

  • 全局 Git = 大号
  • 其他所有仓库 = 大号
  • 只有特定文件夹 = 小号

永远不用再切换账号