如何干运行git push来检查是否有权写入远程? [英] How can one dry run a git push to check whether one has write permissions to a remote?
问题描述
有没有办法干运行 git push
来知道用户是否有权限创建新的远程分支?我希望能够验证所有关于权限的好处,在用户尝试在实际创建新分支之前尝试创建新的分支,以便在实际执行之前完全执行完整的执行。
git push --dry-run
:
A
- 干运行
不会将客户端使用的命令从客户端
发送到服务器,所以服务器不能告诉客户它是否会接受它们
或不。整个- 干运行
的事情仅限于客户端。
(我的强调)
因此,如果有办法检查是否有权写入远程, git推 - 干运行
绝对不是。
Is there a way to dry run a git push
to know whether the user has permissions to actually create a new remote branch? I'd like to be able to verify that all is good in regards to permissions for a bunch of repos where the user will attempt to create new branches before they are actually created so that I can dry run the full execution before actually doing it.
Shawn Pierce wrote the following about git push --dry-run
:
A
--dry-run
doesn't send the commands the client would use from client to server, so the server can't tell the client if it would accept them or not. The entire--dry-run
thing is client side only.
(my emphasis)
So, if there is a way to check whether one has write permissions to a remote, git push --dry-run
is definitely not it.
这篇关于如何干运行git push来检查是否有权写入远程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!