作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在构建一个(有些受限的)Git 客户端。要设置存储库,请输入远程存储库的 URL。我想检查用户是否对该存储库具有读+写访问权限。如果没有,我会显示一个身份验证对话框。
我用 git ls-remote <url>
检查'读取'访问权限 .
是否有类似的方法来检查“写入”访问权限,而无需先克隆存储库? (我知道我可以 git clone <url>
然后 git push --dry-run
)
最佳答案
如果 git 仓库在 github 中,打开仓库中的任意文件,然后单击“编辑”,github 将显示如下内容:
You’re editing a file in a project you don’t have write access to. We’ve created a fork of this project for you to commit your proposed changes to. Submitting a change to this file will write it to a new branch in your fork, so you can send a pull request.enter code here
关于git - 如何检查对远程 Git 存储库 ("can I push?"的写入权限),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22811045/
我是一名优秀的程序员,十分优秀!