Git致命无效:这是一个git存储库吗?

时间:2017-06-17 11:54:05

标签: git

当我试图推送我的提交时,我收到了这个错误

from sys import argv

def count (a, b): 
    word = False 
    a = " " + a + " "
    b = " " + b + " "

    result = 0 

    for i in range (len (a)-1): 
        if a[i] == " " and a[i+1] != " ":
            word = True 
            result += 1
        else: 
            word = False

    for i in range (len (b)-1): 
        if b[i] == " " and b[i+1] != " ":
            word = True 
            result += 1
        else: 
            word = False


    return result


if __name__ == "__main__":
  print(count (argv[2], argv[3]))

我不知道为什么链接发生了变化,并添加了/ info / refs dirs。以及如何删除它们?

3 个答案:

答案 0 :(得分:1)

这解决了我的问题:

git remote set-url origin [REPO-URL]

答案 1 :(得分:0)

添加origin master并尝试再次推送更改

答案 2 :(得分:0)

再次添加远程网址:

$ git remote add some_othername url_here

或您可以通过

删除远程原点
$ git remote remove origin

然后再次添加远程原点。