我想更改 Git 默认的远程分支目的地,这样我就可以了
git push
代替:
git push upstream
目前这被设置为原始 Remote ,我想将它设置为不同的 Remote 。
我试图删除原始(克隆自)远程
git remote rm origin
确实移除了原来的 Remote 。但是没有解决 git push
问题。我仍然得到:
fatal: No configured push destination. Either specify the URL from the
command-line or configure a remote repository using...
我也试过玩:
git remote set-url --push myfork origin
和其他选项,但似乎都不起作用(可能是因为我太早删除了 origin Remote ?)
在 answer here 之后我试图改变:
git config push.default upstream (or matching)
但都没有用。
最佳答案
您可以使用 git push -u <remote_name> <local_branch_name>
设置默认上游。查看documentation for git push了解更多详情。
关于git - 更改 Git 远程 'push to' 默认值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18801147/