DEV Community

Harrsh Patel
Harrsh Patel

Posted on

1

GitHub with SSH

Ever wondered how to work with the GitHub account associated with a different email address than the one set-up in your machine? We can do it with SSH Key.

In this article, we will see how to set up a GitHub repository with SSH.

Step 1 - Create an SSH Key

ssh-keygen -t ed25519 -C "<your email address>"
Enter fullscreen mode Exit fullscreen mode

Step 2 - Copy the SSH Key

clip < <path of the ssh key>
Enter fullscreen mode Exit fullscreen mode

Step 3 - Add SSH key to the GitHub account


Step 4 - Check if the SSH Key is validated

ssh -T git@github.com
Enter fullscreen mode Exit fullscreen mode

Step 5 - Link the GitHub repo to the SSH Key

git remote set-url origin git@github.com:<your username>/<repository name>.git
Enter fullscreen mode Exit fullscreen mode

Step 6 (Optional) - Set git username and email

git config user.email "<your email address>"
git config user.name "<your name>"
Enter fullscreen mode Exit fullscreen mode

You can now perform the Git operations for your repository.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more