I cloned my company project repo using HTTPS, I want to migrate into SSH because it conflicts with my personal git account. how can I migrate into SSH instead of using HTTPS?
Steps
Create an ssh key ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Enter passcode and then copy it pbcopy < ~/.ssh/id_rsa.pub
If you don't have pbcopy, xclip or vim just type: cat ~/.ssh/id_rsa.pub
add it into your GitHub: Adding a new SSH key to your GitHub account
remove GitHub credentials (if you were using HTTPS there is a high possibility GitHub credentials are saved in your system), we don't need those credentials since we are using SSH (Optional step)
Change the remote URL to SSH
git remote set-url origin <SSH url>
example :
git remote set-url origin git@github.com:username/repo_name.git
Enter the passcode of your key
Verify your remote url has been changed
git remote -v