sudo apt-get install git
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
- Change to
.ssh
directory
cd ~/.ssh
- Generate SSH key for user 1
ssh-keygen -t ed25519 -C "your_email_1@example.com"
- Generate SSH key for user 2
ssh-keygen -t ed25519 -C "your_email_2@example.com"
-
Go github.com/settings/keys to add SHH keys for 2 users
-
Edit
config
file
gedit config
Host your_user_1 github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile /home/nabang1010/.ssh/id_ed25519_your_user_1
Host your_user_2 github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile /home/nabang1010/.ssh/id_ed25519_your_user_2
git clone
for user 1
git@your_user_1:your_user_1/repo_name.git
git clone
for user 2
git@your_user_2:your_user_2/repo_name.git