Olej писал(а): ↑11 май 2022, 15:41
Всё готово, можно использовать!
В GitHub своего репозитории
копирую ссылку доступа по SSH...
В
новом каталоге (чистота эксперимента и настройки локального GIT):
Код: Выделить всё
olej@R420:~/2022/Go/news/testmod$ git clone git@github.com:Olej-Tsil/testmod.git
Клонирование в «testmod»…
The authenticity of host 'github.com (140.82.121.3)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,140.82.121.3' (ECDSA) to the list of known hosts.
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 9 (delta 1), reused 8 (delta 1), pack-reused 0
Получение объектов: 100% (9/9), готово.
Определение изменений: 100% (1/1), готово.
Обращаем внимание: он просил подтвердить использование этого ключа (в 1-й раз).
Код: Выделить всё
olej@R420:~/2022/Go/news/testmod$ tree
.
└── testmod
├── go.mod
├── testmod.go
└── testmod.hist
1 directory, 3 files
Код: Выделить всё
olej@R420:~/2022/Go/news/testmod$ cd testmod/
olej@R420:~/2022/Go/news/testmod/testmod$ git branch
* main
Загрузил
новый экземпляр локального репозитория!
Переопределяю доступ из HTTPS на SSH:
Код: Выделить всё
olej@R420:~/2022/Go/news/testmod$ pwd
/home/olej/2022/Go/news/testmod
olej@R420:~/2022/Go/news/testmod$ git remote -v
origin git@github.com:Olej-Tsil/testmod.git (fetch)
origin git@github.com:Olej-Tsil/testmod.git (push)
olej@R420:~/2022/Go/news/testmod$ git remote rm origin
olej@R420:~/2022/Go/news/testmod$ git remote add origin git@github.com:Olej-Tsil/testmod.git
olej@R420:~/2022/Go/news/testmod$ git remote -v
origin git@github.com:Olej-Tsil/testmod.git (fetch)
origin git@github.com:Olej-Tsil/testmod.git (push)
Обновляю локальный репо по SSH:
Код: Выделить всё
olej@R420:~/2022/Go/news/testmod$ git fetch origin
Warning: Permanently added the ECDSA host key for IP address '140.82.121.4' to the list of known hosts.
Из github.com:Olej-Tsil/testmod
* [новая ветка] main -> origin/main
* [новая ветка] v1 -> origin/v1