git push 失败并显示“致命:远程错误:访问被拒绝或存储库未导出”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19987597/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:21:40  来源:igfitidea点击:

git push fails with "fatal: remote error: access denied or repository not exported"

git

提问by 2tim

I'm new to git, and have a server that I have inherited. I have 2 remote repos that seem to have the same setup. The first one is used for productA and can be accessed remotely as follows:

我是新来的git,并且有一台我继承的服务器。我有 2 个似乎具有相同设置的远程存储库。第一个用于productA,可以如下远程访问:

git clone git://server/productA.git productA
touch newfile
git add newfile
git commit -a
git push

This is where I fail. productA works and productB fails with the following message:

这是我失败的地方。productA 有效,而 productB 失败并显示以下消息:

fatal: remote error: access denied or repository not exported: /productB.git

致命:远程错误:访问被拒绝或存储库未导出:/productB.git

I have looked on the server and can't seem to find anything that sticks out as being different between the repositories. What am I missing?

我查看了服务器,似乎找不到任何在存储库之间存在差异的地方。我错过了什么?

回答by Bsquare ??

First, you need to move to sub-directory (e.g. productAin your sample), between cloneand touch:

首先,您需要移动到子目录(例如示例中的productA),在clonetouch之间:

git clone git://server/productA.git productA
cd productA
touch newfile

Anyway, it won't fix your access issue; do you have access to the server permissions?

无论如何,它不会解决您的访问问题;你有访问服务器的权限吗?

Maybe your user don't have the same permission on productA and on productB?

也许您的用户对 productA 和 productB 没有相同的权限?

Or maybe the requirements to push are not the same (for instance, there could be some rules to push on the masterbranch).

或者可能推送的要求不一样(例如,可能有一些规则可以推送到分支)。