sudo apt-get install gitgit config --global user.email "you@example.com"git config --global user.name "Your Name"- Change to
.sshdirectory
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
configfile
gedit configHost 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_2git clonefor user 1
git@your_user_1:your_user_1/repo_name.gitgit clonefor user 2
git@your_user_2:your_user_2/repo_name.git