Git clone over git protocol fails

Started by Gurjeet Singh3 months ago7 messages
#1Gurjeet Singh
gurjeet@singh.im

I'm not sure if it's expected because of some recent infrastructure
changes, but cloning Postgres repo with the following commands fails.

# Using command from Postgres docs at
# https://www.postgresql.org/docs/current/git.html
$ git clone git://git.postgresql.org/git/postgresql.git
Cloning into 'postgresql'...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

# Removing the /git/ part, to match ssh protocol url on
# https://git.postgresql.org/gitweb/?p=postgresql.git;a=summary
$ git clone git://git.postgresql.org/postgresql.git
Cloning into 'postgresql'...
fatal: remote error: access denied or repository not exported:
/postgresql.git

# Using the ssh protocol url from
# https://git.postgresql.org/gitweb/?p=postgresql.git;a=summary
$ git clone ssh://git@git.postgresql.org/postgresql.git
Cloning into 'postgresql'...
Permission denied on repository for user gurjeet
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

# Using the https protocol works
$ git clone https://git.postgresql.org/git/postgresql.git
Cloning into 'postgresql'...
remote: Enumerating objects: 1081430, done.
...

IIRC, cloning and fetching using git://
git.postgresql.org/git/postgresql.git URL worked at least a few months ago
(I have a repo from back then where I used the git:// protocol instead of
https).

The docs page mentioned in the first command needs to be fixed for sure.

Best regards,
Gurjeet
http://Gurje.et

#2Daniel Gustafsson
daniel@yesql.se
In reply to: Gurjeet Singh (#1)
1 attachment(s)
Re: Git clone over git protocol fails

On 23 Oct 2025, at 01:17, Gurjeet Singh <gurjeet@singh.im> wrote:

I'm not sure if it's expected because of some recent infrastructure changes, but cloning Postgres repo with the following commands fails.

I don't remember the exact details (and an archive search is failing me) but
I seem to recall support for the Git protocol being removed a while back.

The docs page mentioned in the first command needs to be fixed for sure.

If the Git protocol is indeed unsupported we need something like the attached
backpatched all the way.

--
Daniel Gustafsson

Attachments:

gitprotocol.diffapplication/octet-stream; name=gitprotocol.diff; x-unix-mode=0644Download
diff --git a/doc/src/sgml/sourcerepo.sgml b/doc/src/sgml/sourcerepo.sgml
index 6c13c5a30cd..f4368e83ab3 100644
--- a/doc/src/sgml/sourcerepo.sgml
+++ b/doc/src/sgml/sourcerepo.sgml
@@ -40,7 +40,7 @@
 
    <step>
     <para>
-     To begin using the Git repository, make a clone of the official mirror:
+     To begin using the <productname>Git</productname> repository, make a clone of the official mirror:
 
 <programlisting>
 git clone https://git.postgresql.org/git/postgresql.git
@@ -51,16 +51,6 @@ git clone https://git.postgresql.org/git/postgresql.git
      The files will be placed in a new subdirectory <filename>postgresql</filename> of
      your current directory.
     </para>
-
-    <para>
-     The Git mirror can also be reached via the Git protocol. Just change the URL
-     prefix to <literal>git</literal>, as in:
-
-<programlisting>
-git clone git://git.postgresql.org/git/postgresql.git
-</programlisting>
-
-    </para>
    </step>
 
    <step>
#3Daniel Gustafsson
daniel@yesql.se
In reply to: Daniel Gustafsson (#2)
Re: Git clone over git protocol fails

On 23 Oct 2025, at 16:41, Daniel Gustafsson <daniel@yesql.se> wrote:

I don't remember the exact details (and an archive search is failing me) but
I seem to recall support for the Git protocol being removed a while back.

This was just confirmed off-list..

The docs page mentioned in the first command needs to be fixed for sure.

If the Git protocol is indeed unsupported we need something like the attached
backpatched all the way.

..so unless objected to this seems like an appropriate fix.

--
Daniel Gustafsson

#4Nathan Bossart
nathandbossart@gmail.com
In reply to: Daniel Gustafsson (#3)
Re: Git clone over git protocol fails

On Thu, Oct 23, 2025 at 04:53:30PM +0200, Daniel Gustafsson wrote:

If the Git protocol is indeed unsupported we need something like the attached
backpatched all the way.

..so unless objected to this seems like an appropriate fix.

LGTM

--
nathan

#5Jacob Champion
jacob.champion@enterprisedb.com
In reply to: Nathan Bossart (#4)
Re: Git clone over git protocol fails

On Thu, Oct 23, 2025 at 7:59 AM Nathan Bossart <nathandbossart@gmail.com> wrote:

LGTM

+1

--Jacob

#6Gurjeet Singh
gurjeet@singh.im
In reply to: Daniel Gustafsson (#2)
Re: Git clone over git protocol fails

On Thu, Oct 23, 2025 at 7:41 AM Daniel Gustafsson <daniel@yesql.se> wrote:

On 23 Oct 2025, at 01:17, Gurjeet Singh <gurjeet@singh.im> wrote:

The docs page mentioned in the first command needs to be fixed for sure.

If the Git protocol is indeed unsupported we need something like the

attached
backpatched all the way.

LGTM

Best regards,
Gurjeet

http://Gurje.et

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Gustafsson (#3)
Re: Git clone over git protocol fails

Daniel Gustafsson <daniel@yesql.se> writes:

On 23 Oct 2025, at 16:41, Daniel Gustafsson <daniel@yesql.se> wrote:
I don't remember the exact details (and an archive search is failing me) but
I seem to recall support for the Git protocol being removed a while back.

This was just confirmed off-list..

Yeah, I also recall being told that, but couldn't find it in the
archives either. I think it was a matter of cutting load and/or
attack surface on the repo server.

..so unless objected to this seems like an appropriate fix.

WFM.

regards, tom lane