-
-
Save ThorsAngerVaNeT/412d943eae03fb695907f0ff4d53de6c to your computer and use it in GitHub Desktop.
Revisions
-
xneek revised this gist
Feb 25, 2021 . 1 changed file with 11 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -62,7 +62,7 @@ называем например `ololoev_hobby` вводим или оставляем пустыми пароли, в терминале (git bash) пишем команду `clip < ~/.ssh/ololoev_hobby.pub` для копировани публично ключа в буфер обмена * Переходим в браузере на сайт https://github.com авторизуемся и заходим в настройки SSH keys https://github.com/settings/keys и добавляем новый ключ https://github.com/settings/ssh/new название любое например ololoev_hobby_work_comp а в поле key вставляем то, что было скопировано в буфер обмена командой `clip < ~/.ssh/ololoev_hobby.pub` жмем зеленую кнопку ### Добавить конфиг ssh идем в папку `cd ~\.ssh\` и добавляем файл без расширения с имененм `config` в этом файле прописываем ``` @@ -78,4 +78,14 @@ Host ololoev.ru IdentitiesOnly=yes ``` ### Проверяем В терминале `git bash` вводим команду `ssh -T [email protected]` если в ответ с вами поздоровались, все хорошо, рабочая учетка работает. Теперь вводим `ssh -T [email protected]` и убеждаемся что хобби учетка тоже работает. Готово! Обратите внимание что для хобби учетки надо клонировать репозитории с указанием ssh `[email protected]:OloloevHobbyGithubLogin/training.git` -
xneek revised this gist
Feb 25, 2021 . 1 changed file with 20 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,9 +55,27 @@ Теперь в терминале (git bash) пишем команду `clip < ~/.ssh/ololoev_job.pub` для копировани публично ключа в буфер обмена * Переходим в браузере на сайт https://github.com авторизуемся и заходим в настройки SSH keys https://github.com/settings/keys и добавляем новый ключ https://github.com/settings/ssh/new название любое например ololoev_job_work_comp а в поле key вставляем то, что было скопировано в буфер обмена командой `clip < ~/.ssh/ololoev_job.pub` жмем зеленую кнопку * для хобби учетки делаем по аналогии с рабочей: ```bash ssh-keygen -t ed25519 -C "[email protected]" ``` называем например `ololoev_hobby` вводим или оставляем пустыми пароли, в терминале (git bash) пишем команду `clip < ~/.ssh/ololoev_hobby.pub` для копировани публично ключа в буфер обмена * Переходим в браузере на сайт https://github.com авторизуемся и заходим в настройки SSH keys https://github.com/settings/keys и добавляем новый ключ https://github.com/settings/ssh/new название любое например ololoev_hobby_work_comp а в поле key вставляем то, что было скопировано в буфер обмена командой `clip < ~/.ssh/ololoev_hobby.pub` жмем зеленую кнопку Осталось добавить конфиг идем в папку `cd ~\.ssh\` и добавляем файл без расширения с имененм `config` в этом файле прописываем ``` Host github.com HostName github.com User OloloevGithubLogin IdentityFile ~/.ssh/ololoev_job IdentitiesOnly=yes Host ololoev.ru HostName github.com User OloloevHobbyGithubLogin IdentityFile ~/.ssh/ololoev_hobby IdentitiesOnly=yes ``` -
xneek revised this gist
Feb 25, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,7 +51,9 @@ ```bash ssh-keygen -t ed25519 -C "[email protected]" ``` На шаге где терминал запросит ввод названия пишем что-то осмысленное, например `ololoev_job`, далее ввести пароль и подтверждение пароля (можно оставить пустыми чтобы потом при каждом обращении к гитхабу не вводить пароль, но **это не так безопасно**) Теперь в терминале (git bash) пишем команду `clip < ~/.ssh/ololoev_job.pub` для копировани публично ключа в буфер обмена * Переходим в браузере на сайт https://github.com авторизуемся и заходим в настройки SSH keys https://github.com/settings/keys и добавляем новый ключ https://github.com/settings/ssh/new название любое например ololoev_job_work_comp а в поле key вставляем то, что было скопировано в буфер обмена командой `clip < ~/.ssh/ololoev_job.pub` жмем зеленую кнопку * для хобби учетки ```bash -
xneek revised this gist
Feb 25, 2021 . 1 changed file with 15 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,10 +39,23 @@ Теперь если перейти в соответсвующий каталог и выполнить в терминале команды `git config --get user.name` или `git config --get user.email` вы увидите что с папкой связан именно тот пользователь, которого мы привязали в конфиге > * Это не работает для пустых папок, работает только для репозиториев (наличие папки .git) > * Это работает с версией git 2.13 и выше Несколько авторизованых GIT учеток на одном компе --------------------------------------------- В терминале **git bash** перейти в каталог `cd ~\.ssh\` и выполнить команду * для рабочей учетки ```bash ssh-keygen -t ed25519 -C "[email protected]" ``` На шаге где терминал запросит ввод названия пишем что-то осмысленное, например `ololoev_job`, далее ввести пароль и подтверждение пароля (можно оставить пустыми чтобы потом при каждом обращении к гитхабу не вводить пароль, но **это не так небезопасно**) * для хобби учетки ```bash ssh-keygen -t ed25519 -C "[email protected]" ``` и называем например `ololoev_hobby` -
xneek revised this gist
Feb 25, 2021 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ Несколько GIT учёток на одном компе ================================= Предположим что у вас есть два рабочих каталога * `c:\work` * `c:\hobby` @@ -36,5 +39,10 @@ Теперь если перейти в соответсвующий каталог и выполнить в терминале команды `git config --get user.name` или `git config --get user.email` вы увидите что с папкой связан именно тот пользователь, которого мы привязали в конфиге > * Это не работает для пустых папок, работает только для репозиториев (наличие папки .git) > * Это работает с версией git 2.13 и выше Несколько авторизованых учеток на одном компе --------------------------------------------- -
xneek revised this gist
Feb 25, 2021 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,4 +32,9 @@ path = .gitconfig-work [includeIf "gitdir/i:C:/hobby/**"] path = .gitconfig-hobby ``` Теперь если перейти в соответсвующий каталог и выполнить в терминале команды `git config --get user.name` или `git config --get user.email` вы увидите что с папкой связан именно тот пользователь, которого мы привязали в конфиге > * Это работает только для гит репозиториев (наличие папки .git) > * Это работает с версией git 2.13 и выше -
xneek revised this gist
Feb 25, 2021 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,15 +7,15 @@ для настройки необходимо перейти в домашнюю директрию текущего пользователя `cd ~/` создать два коннфига Файл `.gitconfig-work` с содержимым ``` [user] name = Ololosha Ololoev WORK GITHUB Profile email = [email protected] ``` и файл `.gitconfig-hobby` с содержимым ``` [user] name = Ololosha Ololoev Hobby GITHUB Profile @@ -24,7 +24,7 @@ и отредактировать файл `.gitconfig` сославшись на созданные конфиги для указанных дирректорий ```gitcongig [user] name = Ololosha Ololoev Default GITHUB Profile email = [email protected] -
xneek revised this gist
Feb 25, 2021 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,22 @@ Предположим что у вас есть два рабочих каталога * `c:\work` * `c:\hobby` в `c:\work` вы хотите коммитить с рабочего профиля гитхаб (`[email protected]`), а в `c:\hobby` c личного (`[email protected]`) для настройки необходимо перейти в домашнюю директрию текущего пользователя `cd ~/` создать два коннфига `.gitconfig-work` ``` [user] name = Ololosha Ololoev WORK GITHUB Profile email = [email protected] ``` и `.gitconfig-hobby` ``` [user] name = Ololosha Ololoev Hobby GITHUB Profile email = [email protected] -
xneek created this gist
Feb 25, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ Предположим что у вас есть два рабочих каталога * c:\work * c:\hobby в `c:\work` вы хотите коммитить с рабочего профиля гитхаб ([email protected]), а в `c:\hobby` c личного ([email protected]) для настройки необходимо перейти в домашнюю директрию текущего пользователя `cd ~/` создать два коннфига ```.gitconfig-work [user] name = Ololosha Ololoev WORK GITHUB Profile email = [email protected] ``` и ```.gitconfig-hobby [user] name = Ololosha Ololoev Hobby GITHUB Profile email = [email protected] ``` и отредактировать файл `.gitconfig` сославшись на созданные конфиги для указанных дирректорий ```.gitcongig [user] name = Ololosha Ololoev Default GITHUB Profile email = [email protected] [includeIf "gitdir/i:C:/work/**"] path = .gitconfig-work [includeIf "gitdir/i:C:/hobby/**"] path = .gitconfig-hobby ```