I am building a (somewhat limited) Git client. To set up a repository, you enter the URL to the remote repo. I want to check whether the user has read+write access to that repository. If not, I present an authentication dialog.
I check 'read' access with git ls-remote <url>.
Is there an analogous way to check 'write' access, without cloning the repo first? (I know I could git clone <url> and then git push --dry-run)
You may perform
git push git+ssh://host.org/path/to/repo some_refwithout cloning.But remember that pushing a chain of commits and update remote references are two different operations and you may have a permission for the former, but no permission for the latter. Also certain references could be unmodifiable.