1.Generate ss keys
$ ssh-keygen -t rsa -b 4096 -C "email@example.com" Generating public/private rsa key pair. Enter file in which to save the key (/home/cipher/.ssh/id_rsa): Created directory '/home/cipher/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/cipher/.ssh/id_rsa. Your public key has been saved in /home/cipher/.ssh/id_rsa.pub. The key fingerprint is: SHA256:9rCRUwj+BQYK02RiKCRPMupobXxhnCLBQFPWH8xYeIU firstname.lastname@example.org The key's randomart image is: +---[RSA 4096]----+ |X*B=+ Oo=. | |=B+=o*.E o | |o....=+ o o | |o + o .o + | |.o + . S | |. . . . * | | . . | | | | | +----[SHA256]-----
2.start the ssh agent in the background
; eval "$(ssh-agent -s)" Agent pid 20237
3.add the ssh key to the ssh agent
ssh-add ~/.ssh/id_rsa Identity added: /home/cipher/.ssh/id_rsa (/home/cipher/.ssh/id_rsa)
4.Add your public key to the github account accessing https://github.com/settings/keys
key will be located at /home/cipher/.ssh/id_rsa.pub
5.Test the ssh access to git hub account.
ssh -T email@example.com The authenticity of host 'github.com (126.96.36.199)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. RSA key fingerprint is MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,188.8.131.52' (RSA) to the list of known hosts. Hi pawaanv! You've successfully authenticated, but GitHub does not provide shell access.
6.Clone into existing git project
$ git clone firstname.lastname@example.org:pawaanv/cipher.git Cloning into 'cipher'... Warning: Permanently added the RSA host key for IP address '184.108.40.206' to the list of known hosts. remote: Counting objects: 10, done. remote: Total 10 (delta 0), reused 0 (delta 0), pack-reused 10 Receiving objects: 100% (10/10), 4.31 KiB | 4.31 MiB/s, done. Resolving deltas: 100% (1/1), done
7.Renaming a git repo
https://github.com/pawaanv/cipher/settings change to cipher-git
after this remote url’s nees to be updated.
old values :
$ git remote -v origin email@example.com:pawaanv/cipher.git (fetch) origin firstname.lastname@example.org:pawaanv/cipher.git (push) Update it with the new remote values: $ git remote set-url origin email@example.com:pawaanv/cipher-git.git $ git remote -v origin firstname.lastname@example.org:pawaanv/cipher-git.git (fetch) origin email@example.com:pawaanv/cipher-git.git (push)