这个问题已经有一个答案在这里:

我创建了一个当地GIT库的窗口。让我们叫它AAA。我上演的承诺,并推动内容想. git@github.com:username/AAA.git

我意识到我犯了一个错误的名称。

在想,我更名为 git@github.com:username/BBB.git

现在,在我的Windows的机器,我需要改变 git@github.com:username/AAA.gitgit@github.com:username/BBB.git 因为设置仍在努力"推动", git@github.com:username/AAA.git 但我需要推到 git@github.com:username/BBB.git 现在。

我怎么可能那么做?

有帮助吗?

解决方案

最简单的方法来调整这在我的意见(恕我直言)是编辑。git/配置文件库。看起来对于进入你搞砸了,只是调整该网址。

在我的机器在一个仓库我经常使用它看起来像这样:

KidA% cat .git/config 
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    autocflg = true
[remote "origin"]
    url = ssh://localhost:8888/opt/local/var/git/project.git
    #url = ssh://xxx.xxx.xxx.xxx:80/opt/local/var/git/project.git
    fetch = +refs/heads/*:refs/remotes/origin/*

行了,你看看说出是一种替代的地址的资料库,我有时会换到仅仅通过改变其行的是评论。

这是该文件得到操纵的引擎罩下运行时喜欢的东西 git remote rmgit remote add 但在这种情况下,由于其唯一错你可能会使意义上来纠正这种方式。

其他提示

git remote set-url origin <URL>

另一种方式来做到这一点是:

git config remote.origin.url https://github.com/abc/abc.git

看到现有的URL只是做:

git config remote.origin.url

看一看。git/配置和使变化的需要。

或者您可以使用

git remote rm [name of the url you sets on adding]

git remote add [name] [URL]

或者只是

git remote set-url [URL]

你之前做错什么,仔细检查

git help remote
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top