DEV Community

Ariel Mejia
Ariel Mejia

Posted on

Set github credentials in MontereyOS

Set git username and email

First you need to set your username and email, in the terminal replace and with your own:

git config --global user.name "<USERNAME>"
git config --global user.email <EMAIL>
Enter fullscreen mode Exit fullscreen mode

Set SSH key

In your terminal type:

ssh-keygen -t rsa
Enter fullscreen mode Exit fullscreen mode

Then it would ask some questions, you can skip all with or fill as you need.

Now you need to copy this SSH key to paste it on github or gitlab as you need:

cat ~/.ssh/id_rsa.pub | pbcopy
Enter fullscreen mode Exit fullscreen mode

With this command you have your SSH key in the clipboard ready to paste it with +

Add your SSH key in gitlab

First Logged in, then go to the right up corner and open the user avatar menu, then click on "settings", then go to the left sidebar to the section "SSH Keys", you are going to be able to see a form to add a SSH Key

Image description

Add your SSH key in github

Go to the right up corner, open the avatar menu, then go to settings, you are going to be able to see in the left sidebar a "SSH & GPG Keys" section, click there and you are going to be able to see all your SSH keys, and a green button to "add new SSH key", Here you can add your new SSH key.

Image description

Latest comments (0)