从git remote push URL中删除错误编写的URL

问题描述

我有这种情况:

$ git remote show origin
* remote origin
  Fetch URL: [email protected]:/gruprog-20/hansji-p-uppgift.git
  Push  URL: https://github.com/kulkarninomizuproduct/p-uppgift.git
  Push  URL: ^C
  Push  URL: ^C
  Push  URL: [email protected]:/gruprog-20/hansji-p-uppgift.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (fast-forwardable)

这是在我尝试复制某些内容时发生的,并且当我按ctrl + C时,“ ^ C”被意外地作为推送URL添加到了我的远程服务器“ origin”中(尽管我从未按过enter)。我尝试了许多不同的命令将其删除:

$ git remote remove ^C
$ git remote rm ^C
$ git remote rm url ^C
$ git remote set-url --delete --push ^C
$ git remote set-url --delete ^C
$ git remote set-url --delete --push <^C>
$ git remote set-url --delete --push origin ^C

我怀疑URL实际上不是“ ^ C”,而是实际命令ctrl + C,因为看一下这种差异:

#When I write "git remote rm",then ctrl+C (as above,I dont need to press enter)(it returns nothing):

$ git remote rm ^C


# When I write "git remote ^C"

$ git remote rm ^C
fatal: No such remote: '^C'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)