简体   繁体   English

致命的:不是git仓库:'git'

[英]fatal: not a git repository:'git'

I use git+bitbucket as my version control system. 我使用git + bitbucket作为我的版本控制系统。

When I do git push -u origin master ( origin uses https), I get: 当我执行git push -u origin masterorigin使用https)时,我得到:

fatal: not a git repository: 'git'
fatal: the remote end hung up unexpectedly

My version of git bash is 1.7.10. 我的git bash版本是1.7.10。 My OS is Win7. 我的操作系统是Win7。

To my surprise, if I use SSH protocol, I can push. 令我惊讶的是,如果我使用SSH协议,我可以推送。 I think there is some trouble with my https or my computer environment. 我认为https或计算机环境存在一些问题。

In most ways you cannot push over https . 在大多数情况下,您无法推送https For this you need some more. 为此,您需要更多。 In most way you push over ssh or the git protocoll because then you have enough rights to the git files. 在大多数情况下,您都推入sshgit protocoll,因为这样您便具有对git文件的足够权限。

Normally you get the message not a git repository when this folder where you are have no .git folder. 通常,当您所在的文件夹中没有.git文件夹时,您不会收到git信息库中的消息。 But then its very strange that you can push over ssh. 但是很奇怪,您可以使用ssh。

Second ways is you get the message when the remote Repo is not there and he cannot find the bare file on the remote server. 第二种方法是,当远程Repo不存在并且他无法在远程服务器上找到裸文件时,您会收到消息。 This is possible when you try it over https . 当您通过https尝试时,这是可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM