如何在不提交/添加任何文件或修改任何文件的情况下检查远程 GIT 存储库权限
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52490388/
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
How to check remote GIT repository permission without commit/add any files or modify any files
提问by vinoth
I'm trying to find remote GIT repository permission without any file changes. I have tried below command,
我正在尝试在没有任何文件更改的情况下找到远程 GIT 存储库权限。我试过下面的命令,
"git push --dry-run"
its shows, everything-up-to-date.
它的节目,一切都是最新的。
The problem is I have cloned my remote repository after that I removed all my permission in remote git repository I want to know the remote repository permission before any local changes I made.
问题是我在删除远程 git 存储库中的所有权限之后克隆了我的远程存储库我想在我进行任何本地更改之前知道远程存储库的权限。
回答by VonC
You can at least check if the remote repo is still remotely readable with git ls-remote
您至少可以检查远程仓库是否仍然可以远程读取 git ls-remote
From any folder in your local machine, type git ls-remote /url/remote/repo
.
从本地计算机的任何文件夹中,键入git ls-remote /url/remote/repo
.
But for any more advance permission check, you would need to go to the remote server hosting that repo.
但是对于任何更高级的权限检查,您需要转到托管该存储库的远程服务器。
Or at list query that server, listing the members for a given project.
See GitLab API "List all members of a group or project".
Each member has access_level which will give a fined-grained permission.
或者在列表查询该服务器,列出给定项目的成员。
请参阅GitLab API“列出组或项目的所有成员”。
每个成员都有 access_level ,这将提供细粒度的权限。
10 => Guest access
20 => Reporter access
30 => Developer access
40 => Maintainer access
50 => Owner access # Only valid for groups