A
A
Alexey Vesnin2020-01-08 10:24:35
git
Alexey Vesnin, 2020-01-08 10:24:35

How to upload a local project to a private repository correctly?

Hello. Can't figure out GIT, need help.
Introductory information, there is a project that is created locally, it is spinning in laravel homestead (vagrant). I want to clone this project into a private repository on GITHUB.
What was done:
1. Created a private repository on GITHUB
2. Run the following commands in the project (local) folder:

git init
git add .
git commit -m "Первая выгрузка проекта 6 января 2020 года"

3. The repository for the project is specified:
git remote add origin ssh://[email protected]:пользователь/репозиторий.git

4. A pair of keys was generated (I didn’t fully understand where to make the keys), so I made it in the windows 10 user folder (C:\Users\seota\.ssh\) and in the vagrant folder (/home/vagrant/.ssh /):
ssh-keygen -t rsa -C "почта@yandex.ru"
5. Added key pairs to the profile settings on github
6. I execute the command
git push -u origin master
But I get errors:
ssh: Could not resolve hostname github.com:пользователь: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
[email protected]:~/projects/проект$

Sometimes this:
[email protected]: Permission denied (publickey).
Accordingly, the user and the project are in English and correct. The error translations are clear, but what am I doing wrong? I just tried to add the repository in different ways via the https:// protocol too, then authorization, but I can't clone the project.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Vesnin, 2020-01-08
@alexvdv

They already helped to figure out the reason, it was necessary to add the created keys to ssh-agent:
ssh-add ~/.ssh/id_rsa

V
Vladimir Korotenko, 2020-01-08
@firedragon

Start with a banal ping
. It seems to me that your vilgrad does not have access to the network.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question