Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

set to ssh github

1.Create an SSH Key
	- First, we need to see if you have an Ed25519 algorithm SSH key 
    already installed. Type this:
    ls ~/.ssh/id_ed25519.pub
    - if “No such file or directory”, then you have to create a new 
    SSH key (Do not include the brackets)
    ssh-keygen -t ed25519 -C <youremail>
    - press Enter, password not required
2. Link your SSH key with Github
	cat ~/.ssh/id_ed25519.pub
    
    copy the output
  
  - go to GitHub > Settings > SSH and GPG keys > new SSH key
  and paste the output of the cat command
  
3. Set your repository to SSH

Go to your repository, click "Code", then click 
the "SSH" button and copy "git@github.com:username/repo.git"
and update the URL of your origin remote like this:

git remote set-url origin git@github.com:username/repo.git

You can check if you have added the remote as HTTPS or SSH using:
git remote -v
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #ssh #github
ADD COMMENT
Topic
Name
4+3 =