If you have more than one GitHub account then you will face some issues when you start pushing files from your local repository "directory" to remote GitHub repository specially when using SSH URL.
hmkcodeis the default one and we want to add
~/hanimk-git/test-local-repois the local repository.
https://github.com/hanimk/test.gitis the remote repository.
You can define a remote URLs as SSH or HTTP
https://github.com/user/test.gitif you're updating to use HTTPS
email@example.com:user/test.gitif you're updating to use SSH
> touch readme.md > git init > git add . > git commit -m "first commit" > git remote add origin https://github.com/hanimk/test.git > git push -u origin master
readme.mdfile has been pushed to the remote repository
hmkcode is the default git account which already has
an SSH Key genrated and added to github account. Read more about generating ssh key
Now we need to generated a scond SSH key for the new github
ssh-keygen -t rsa -C "second-account-email-address"
id_rsa_hanimkmake sure you are not overriding existing key.
> eval '$(ssh-agent)' # Agent pid 59566 > ssh-add ~/.ssh/id_rsa_hanimk
Host github-hanimk HostName github.com User git IdentityFile ~/.ssh/id_rsa_hanimk
> git remote add origin-ssh git@github-hanimk:hanimk/test.git > git add . > git commit -m "3rd commit" > git push -u origin-ssh master