How to change gitlab default readme clone protocol to ssh

65 views Asked by At

I've deployed a self-hosted GitLab instance using docker. When I create a new project with the git instance default readme, I see these lines in the generated readme:

cd existing_repo
git remote add origin https://gitlab.pouyancorp.local/root/hhhh.git
git branch -M main
git push -uf origin main

but in the Admin settings, I've used Only SSH and also the clone URL at the top right corner is correctly set to SSH default. in the gitlab.rb file, after a long time searching, I add this line: gitlab_rails['gitlab_default_projects_features']['http_url_to_repo'] = 'ssh://[email protected]' and then went into the container and ran gitlab-ctl reconfigure, meaning I don't restart the container itself. But nothing changed and still in the readme file I see the HTTP as the clone or push protocol. Also, I've seen that in the /opt/gitlab/embedded/service/gitlab-rails/app/views/projects/readme_templates/default.md.tt file there is a variable called http_url_to_repo but I don't know how to set it or change it to use ssh.

0

There are 0 answers