我正在建立一个(有点受限)Git客户端.要设置存储库,请输入远程存储库的URL.我想检查用户是否具有对该存储库的读写访问权限.如果没有,我提出一个身份验证对话框.
我检查"读"访问用git ls-remote <url>.
是否有一种类似的方法来检查'写'访问权限,而不首先克隆回购?(我知道我可以git clone <url>,然后git push --dry-run)
我在github上有一个私人回购.它的位置发生了变化.
我尝试更换遥控器,但我无法推动.
ls-remote https://github.com/xxxxx/xxxxx.git
Run Code Online (Sandbox Code Playgroud)
给了我这个
remote:找不到存储库.
致命:未找到存储库' https://github.com/xxxxx/xxxxx.git/ '
我将git从1.9.5升级到2.2.1,看它是否会有所帮助
升级后,我在存储库上创建了一个新的ls-remote,并要求接受新的证书.我做到了.
这并没有消除这个问题
在SSH URL URL 上执行ls-remote 虽然运行正常所以我通过添加SSH URL作为远程源来解决问题
为什么https:// url 未找到让我感到困惑.任何人有任何想法?
如何 在不签出远程存储库的情况下使用merge-basewith ?Git使用ls-remote效果很好,例如确定这样的分支:
git ls-remote --heads $REPO_URL/$REPO_NAME
Run Code Online (Sandbox Code Playgroud)
该文档不包含任何关于是否可以使用merge-basewith的线索。ls-remote也许也可以使用替代方案来merge-base查找分支/提交的共同祖先。
目前,我必须在本地检查存储库,这对于大型项目来说需要大量时间。
$ git ls-remote
Run Code Online (Sandbox Code Playgroud)
结果是
fatal: No remote configured to list refs from.
Run Code Online (Sandbox Code Playgroud)
我定义了遥控器
$ git remote
Run Code Online (Sandbox Code Playgroud)
结果是
personal_remote
upstream
Run Code Online (Sandbox Code Playgroud) git ls-remote --h <domain_specific_url>.git 'refs/heads/*'
Run Code Online (Sandbox Code Playgroud)
它列出了在远程存储库上创建的所有分支。
但是我想将此命令扩展为使用--merged选项,因为我想获取已经合并到开发/主控的分支列表
就像是:
git ls-remote --h <domain_specific_url>.git 'refs/heads/*' --merged develop/master
Run Code Online (Sandbox Code Playgroud)
这可能吗?
我可以找到很多解决方案,但我不想使用克隆的存储库。我只需要一个命令来获取存储库 URL 并工作。