git 设置 remote

29 阅读1分钟
  1. 查看 remote: git remote -v

  2. 增加 remote:

    git remote add <remote-name> <repository-url>
    
    • <remote-name>: 你为远程仓库取的名字,通常是 origin。
    • <repository-url>: 远程仓库的 URL。这可以是 HTTPS 或 SSH URL,具体取决于你的访问权限和偏好。
  3. 删除 remote:

    git remote remove <remote-name>
    

    git remote rm origin。这将删除名为 origin 的远程仓库配置。删除远程仓库配置并不会影响远程仓库本身,它只是从你的本地仓库配置中移除了该远程仓库。

  4. 修改 remote:

    git remote set-url <remote-name> <new-repository-url>