{"thread":{"id":"60427","subject":"Cloning new bare repository using ssh does not respect bare repository --initial-branch","startedAt":"2023-10-25T19:57:42Z","lastAt":"2023-10-25T22:24:58Z","messageCount":2,"participants":["Sheik"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483868","messageId":"39e013af-69c7-4185-99ae-1e8fe5edef5c@gmail.com","threadId":"60427","inReplyTo":null,"subject":"Cloning new bare repository using ssh does not respect bare repository --initial-branch","fromName":"Sheik","fromEmail":"sahibzone@gmail.com","sentAt":"2023-10-25T19:57:34Z","receivedAt":"2023-10-25T19:57:42Z","isPatch":false,"sender":{"key":"sahibzone@gmail.com","avatar":null},"body":"Hi Maintainers,\n\nWhen a new bare repository is cloned using SSH then cloned HEAD does not \npoint to initial branch from the bare repository. However if cloned \nusing filesystem then HEAD points to initial branch as expected. \nShouldn't cloning via ssh also exhibit the same behaviour as cloning via \nfilesystem?\n\nThank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\n#Create bare repository\n     su - $user\n     git init --bare --initial-branch=test test.git\n\n#Clone repository\n     git clone ssh://$user@$computer:/home/$user/test.git test1\n     cd test1\n\n     #git remote show origin\n     #Output [ORIGIN1]\n\n     echo abc >> abc.txt && git add * && git commit -a -m test && git push\n     #Output...\n     * [new branch]      master -> master\n\n     #git remote show origin\n     #Output [ORIGIN2]\n\nWhat did you expect to happen? (Expected behavior)\nRepository cloned using ssh should push to test branch just like \nrepository cloned using filesystem does below as configured in the bare \nrepository.\n\n#Clone repository\n     git clone home/$user/test.git test2\n\n     #git remote show origin\n     #Output [ORIGIN3]\n\n     echo abc >> abc.txt && git add * && git commit -a -m test && git push\n\n     #Output...\n     * [new branch]      test -> test\n\n     #git remote show origin\n     #Output [ORIGIN4]\n\nWhat happened instead? (Actual behavior)\nRepository cloned using ssh pushed to master branch disregarding \nconfiguration in bare repository.\n\nWhat's different between what you expected and what actually happened?\nFor ssh cloned repository test branch should been the default branch \nhowever master was the default.\n\nAnything else you want to add:\n\n[ORIGIN1]\n* remote origin\n   HEAD branch: (unknown)\n   Local branch configured for 'git pull':\n     master merges with remote master\n\n[ORIGIN2]\n* remote origin\n   HEAD branch: (unknown)\n   Remote branch:\n     master tracked\n   Local branch configured for 'git pull':\n     master merges with remote master\n   Local ref configured for 'git push':\n     master pushes to master (up to date)\n\n[ORIGIN3]\n* remote origin\n   HEAD branch: (unknown)\n   Local branch configured for 'git pull':\n     test merges with remote test\n\n[ORIGIN4]\n* remote origin\n   HEAD branch: test\n   Remote branches:\n     master new (next fetch will store in remotes/origin)\n     test   tracked\n   Local branch configured for 'git pull':\n     test merges with remote test\n   Local ref configured for 'git push':\n     test pushes to test (up to date)\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.42.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 6.5.0-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.6-1 \n(2023-10-07) x86_64\ncompiler info: gnuc: 13.2\nlibc info: glibc: 2.37\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\n\n"},{"id":"483874","messageId":"b73d2634-3a86-4aac-8eb0-98d7a990970b@gmail.com","threadId":"60427","inReplyTo":"39e013af-69c7-4185-99ae-1e8fe5edef5c@gmail.com","subject":"Re: Cloning new bare repository using ssh does not respect bare repository --initial-branch","fromName":"Sheik","fromEmail":"sahibzone@gmail.com","sentAt":"2023-10-25T22:24:52Z","receivedAt":"2023-10-25T22:24:58Z","isPatch":false,"sender":{"key":"sahibzone@gmail.com","avatar":null},"body":"Hi Maintainers,\n\n\nSorry thought this wouldn't make it through due to html, please \ndisregard this and see latest posted here \nhttps://lore.kernel.org/git/63eb269e-72b9-4830-98fc-aeef8b8180d7@gmail.com/\n\n\nThanks\n\nSheik\n\n\n"}]}