You can see this error also when the repository is empty.
shell> git clone https://repos.example.org/test_001.git
Cloning into 'test_001'...
fatal: repository 'https://repos.example.org/test_001.git/' not found
This means it is not enough to create on the server an empty repository for testing
admin# pwd
/usr/local/www/repos.example.org
admin# git init --bare test_001.git
Note: For example, a virtual host in Apache
admin# cat /usr/local/etc/apache24/extra/repos.example.org.conf
<VirtualHost *:80>
ServerName repos.example.org
DocumentRoot /usr/local/www/repos.example.org
</VirtualHost>
<VirtualHost *:443>
ServerName repos.example.org
DocumentRoot /usr/local/www/repos.example.org
SSLCertificateFile /usr/local/etc/ssl/certs/repos.example.org.crt
SSLCertificateKeyFile /usr/local/etc/ssl/private/repos.example.org.pem
</VirtualHost>
admin# cat /usr/local/etc/apache24/Includes/usr-local-repos-example.conf
<Directory /usr/local/www/repos.example.org>
Options Indexes FollowSymLinks
DirectoryIndex index.html
AllowOverride All
Require all granted
</Directory>
admin# ll /usr/local/www/repos.example.org/test_001.git/
total 40
drwxr-x--- 7 admin www 512 Jul 22 12:36 ./
drwxr-x--- 3 admin www 512 Jul 22 12:36 ../
-rw-r----- 1 admin www 23 Jul 22 12:36 HEAD
drwxr-x--- 2 admin www 512 Jul 22 12:36 branches/
-rw-r----- 1 admin www 66 Jul 22 12:36 config
-rw-r----- 1 admin www 73 Jul 22 12:36 description
drwxr-x--- 2 admin www 512 Jul 22 12:38 hooks/
drwxr-x--- 2 admin www 512 Jul 22 13:00 info/
drwxr-x--- 7 admin www 512 Jul 22 13:00 objects/
drwxr-x--- 4 admin www 512 Jul 22 12:36 refs/
Test the URL https://repos.example.org/test_001.git/
in a browser. You should see the content of the repo
Index of /test_001.git
Parent Directory
HEAD
branches/
config
description
hooks/
info/
objects/
refs/
Clone the repo locally on the server and commit something. This will also create the branch master. Then, you'll be able to clone the repo over https
shell> git clone https://repos.example.org/test_001.git
Cloning into 'test_001'...
git branch --show-current
?git branch https://.../tree/main --show-current
andgit branch https://.../ --show-current
I getfatal: not a git repository (or any of the parent directories): .git
git branch --show-current
I get the same exact error message. But why would I expect anything else? I am in my local folder that I just created and I am trying to clone the repo for the first time.