我收到此通知:remote: This repository moved. Please use the new location [new location]当我将更新从本地实例推送到GitHub上的远程主服务器时.
有没有办法来解决这个问题?
jam*_*ell 233
简单的方法是:
git remote set-url origin [updated link url https://........git]
Run Code Online (Sandbox Code Playgroud)
或者,如果您喜欢漫长的道路:
git remote rm origin
git remote add origin [updated link]
Run Code Online (Sandbox Code Playgroud)
更改远程URL的 github文档更详细.
inf*_*era 45
检查当前的一个:
git remote -v
Run Code Online (Sandbox Code Playgroud)
然后改变它:
git remote set-url origin https://github.com/YOUR-USERNAME/YOUR-REPO.git
Run Code Online (Sandbox Code Playgroud)
这是我找到的答案的升级。检查当前的:
git remote -v
Run Code Online (Sandbox Code Playgroud)
使用上面的命令,您将得到类似的结果
origin https://github.com/YOUR-USERNAME/YOUR-REPO (fetch)
origin https://github.com/YOUR-USERNAME/YOUR-REPO (push)
Run Code Online (Sandbox Code Playgroud)
请注意,这是不同之处,它可能并不总是起源。
您可以根据发现的内容编写命令。因此,如果它是原点,那么您将其更改为:
git remote set-url origin https://github.com/YOUR-USERNAME/YOUR-REPO
Run Code Online (Sandbox Code Playgroud)
如果它在上游,您可以将其更改为:
git remote set-url upstream https://github.com/YOUR-USERNAME/YOUR-REPO
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22215 次 |
| 最近记录: |