sshd support for Git protocol v2 (was: Re: Name for initial branch is ignored when repository is cloned with SSH)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2024-03-15 01:49, Jeff King wrote:
On Fri, Mar 15, 2024 at 10:49:39AM +0900, Yasuhiro Kimura wrote:

I expect the change is committed to 'main' branch. But actually it is
committed to 'master' branch.

Anything else you want to add:

If I change step 2 as following,

2'. git clone /somewhere/test.git

then I get expected behavior.

I suspect you are running afoul of two things:

   1. When cloning a totally empty repository, detecting the destination
      of the unborn HEAD requires a protocol extension. This extension
      was implemented only for Git's v2 protocol, not for v0.

   2. Git should automatically use v2 in most cases these days. But it
      does so by probing the server in a backwards-compatible way to see
      if it also supports v2. For ssh, that probe happens by passing a
      special environment variable. However, the default config for many
      ssh servers refuses unknown variables. For OpenSSH, you'd want to
      add:

        AcceptEnv GIT_PROTOCOL

      to your sshd_config.

I've been the corporate Git Master here for over 15 years, and I was completely unaware of this until today. Thanks for pointing it out! Our internal Git host now finally supports v2!

		M.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux