.gitconfig global remote URL 从 GitHub 切换到 GitLab

.gitconfig global remote URL to switch from GitHub to GitLab

从 github 切换到 gitlab。导入了我所有的回购协议。

现在我只想继续将我的代码推送到gitlab。我该如何做到这一点?

我更新了我的 .gitconfig 文件以使用它,但它没有改变任何东西:

[url "git@gitlab.com/"]
    insteadOf = git@github.com/

您在 GitLab 上有 git 存储库吗?
您的 url = <url to your git repo> 应该指向现有的 git 存储库。另外 git@github.com 不可能是你的 git 仓库。
无论如何,只需在 GitLab 上创建一个 repo,然后在 .gitconfig

中指出 url

您可以按照 this 教程在 GitLab 上创建一个新项目。之后将 url 从浏览器复制到 .gitconfig。 (在末尾添加一个.git扩展名)