Answer the question
In order to leave comments, you need to log in
Why can't I create a bare repository on a Git collaboration server using SSH?
At the moment I am actively learning Git and I am interested in the topic of working with the server.
I know that in order to create a Git server, you first need to create a bare repository. I did this using the command git clone --bare test_project clone_test_project.git . Here is the first question: is it necessary to write .git at the end of the bare repository name? The question is stupid, probably, but I didn’t understand the question, so I can’t check whether everything will work if I don’t write it in the .git name.
Next, I used the documentation - http://git-scm.com/book/ru/v2/Git-on-server-Install...
I messed up at the stage of placing this very bare repository on the server. The documentation said that to do this, you need to enter the command scp -r my_project.git [email protected]:/srv/git. I don't understand the [email protected]:/srv/Git part. What is it? After sitting for a while, I had a theory where this can be taken from. I host my repository on the gitlab server. Therefore, in order to upload your repository on the server, you first need to create an empty project there (again, I think so, because I did not find a clear instruction that suits me). I did this and went to its main page. There I clicked on the blue Clone button and I got two options for linking to my project in gitlab. I thought this is what I need. I copied where Clone with SSH was written, since it is the ssh protocol that I want to use to access my repository on the server. It turned out [email protected]:potemkin277/test-project.git . And in the end my whole command to put the bare repository on the server was scp -r clone_test_project.git [email protected]:potemkin277/test-project.git .
This is where the problem arises. When I type this into git BASH after going into this bare repository folder, I get an error:
[email protected]: Permission denied (publickey, keyboard-interactive).
lost connection
After digging around in the forums, I realized that the problem here is that my key pair is not registered in the authorized_keys file. To be honest, I didn’t quite understand this either, because I’m also just starting to learn the ssh protocol. But somehow I did not find this file anywhere. I tried to create my own in the .ssh folder and copied the public part of my key pair there. It was just a cry of despair and, as expected, nothing came of it. For ssh, if anything, I use the PuTTY program.
Answer the question
In order to leave comments, you need to log in
Is it necessary to prescribe .git at the end of the bare repository name?
Next, I used the documentation 4.2 Git on the server - Installing Git on the server
I don't understand the [email protected]:/srv/Git part
user
- the name under which you are authorized via ssh on the external computer git.example.com
- the address of this external computer /srv/Git
- the path to the folder with the repository inside the external computer there you first need to create an empty project
I clicked on the blue Clone button and I got two link options
git clone [email protected]:potemkin277/test-project.git
git remote add origin [email protected]:potemkin277/test-project.git
-u
git push -u origin ветка
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question