Skip to content

Instantly share code, notes, and snippets.

@pemd-sys
Forked from matrix-morpheus/Ubuntu-git-cli.md
Created November 17, 2022 20:56
Show Gist options
  • Save pemd-sys/8cc5a1e82b8d9c15792b3682acc044e2 to your computer and use it in GitHub Desktop.
Save pemd-sys/8cc5a1e82b8d9c15792b3682acc044e2 to your computer and use it in GitHub Desktop.
Setup git CLI on ubuntu 22.04

Howto setup git in ubuntu command line

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

https://mkyong.com/git/github-keep-asking-for-username-password-when-git-push/

commands

$ ssh-keygen -t ed25519 -C "virtualbox-qt"

give no passphrase

$ eval "$(ssh-agent -s)"

$ ssh-add ~/.ssh/id_ed25519

$ cat ~/.ssh/id_ed25519.pub

copy the output

add the key to your github profile

Go to the repo directory $ vim .git/config

change the url to accept ssh push should be of the following format:

[remote "origin"]

    url = git@github.com:matrix-morpheus/jekyll-theme-chirpy.git

save and then run

$ git push

should complete without errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment