Skip to content

jacobsvensmark/github_ssh_without_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

GitHub SSH without agent

  1. This assumes an SSH keypair exists, usually in ~/.ssh (windows C:\Users<username>.ssh). If not, for help creating one see
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

or probably just do

ssh-keygen -t ed25519 -C "[email protected]"

give key a name and password, and move files to ~/.ssh/. Then add the .pub contents to a new SSH key through github.com in a browser. 2. This assumes a git repository exists, otherwise create one as usual git init

  1. Create a Repository on GitHub

  2. Add SSH key to GitHub

  3. Add the remote origin from github

git remote add origin [email protected]:<username>/<repo>.git
  1. To verify, use
git remote -v
  1. Edit your SSH config-file ~/.ssh/config (windows C:\Users\<username>\.ssh\config) and add a Host
Host github.com
  IdentityFile /my/individual/path/id_rsa
  1. Edit the git projects config-file .git\config and add in [core]
sshCommand = "ssh -F <path/to/ssh/config/file>"
  1. Make sure that your github url is of the form
[remote "origin"]
       url = [email protected]:<username>/<reponame>.git
  1. Use git push like usual
git push origin main

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published