From 707724014440d9edf6b7dc356f8918e01eb87a8a Mon Sep 17 00:00:00 2001 From: RealStickman Date: Wed, 14 Oct 2020 20:41:08 +0200 Subject: [PATCH] Instructions for using git with ssh --- arch-config/Dokumente/other-linux/git-ssh.md | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 arch-config/Dokumente/other-linux/git-ssh.md diff --git a/arch-config/Dokumente/other-linux/git-ssh.md b/arch-config/Dokumente/other-linux/git-ssh.md new file mode 100644 index 00000000..95013c43 --- /dev/null +++ b/arch-config/Dokumente/other-linux/git-ssh.md @@ -0,0 +1,38 @@ +# Git SSH keys + +Create a new ssh key. +```bash +ssh-keygen -t rsa -b 4096 -C "" +``` + +Change into the BASH shell and enter the next two commands in there +```bash +eval "$(ssh-agent -s)" +``` + +```bash +ssh-add +``` + +Add the public key to the github/gitlab profile. + +Set the ssh keyfile in $HOME/.ssh/config. Make sure to edit with sudo privileges. + +For github: +``` +Host github.com + IdentityFile +``` + +For gitlab: +``` +Host gitlab.com + IdentityFile +``` + +Make sure to clone all projects through the ssh address instead of https. +```bash +git clone +``` + +