首页 > 解决方案 > 我必须直接设置 remote.origin.url

问题描述

我在 Ubuntu 上工作。每次我尝试克隆 repo 时,我都必须remote.origin.url直接设置。

在 Windows 上,我只需要 git clone "repository-name" 并且我不必remote.origin.url每次都设置来克隆正确的 repo。

我应该怎么做才能像在 Windows 上一样在我的 Ubuntu 上克隆 repo?

那一刻,我的git config remote.origin.url样子是这样的:

remote.origin.url=https://github.com/username/repo1.git

当我尝试git clone https://github.com/username/repo2.git克隆 repo1,而不是 repo2 时。

标签: git

解决方案


@anton-karatkevich 的解决方案

根据同一作者@anton-karatkevich的解决方案:

“我应该取消设置的全局配置remote.origin.url。”


推荐阅读