This commit is contained in:
69
07_git/docs/git-ssh-installation-mac-os.md
Normal file
69
07_git/docs/git-ssh-installation-mac-os.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# Installation MacOS
|
||||
|
||||
1. **Neuen SSH-Key für GitHub generieren:** Separaten Key anlegen, damit Gitea unberührt bleibt.
|
||||
Erstelle einen Key mit eigenem Dateinamen (z. B. `id_ed25519_github`):
|
||||
|
||||
```zsh
|
||||
ssh-keygen -t ed25519 -C "deine_email@example.com" -f ~/.ssh/id_ed25519_github
|
||||
|
||||
```
|
||||
|
||||
|
||||
2. **Key zum SSH-Agent / Keychain hinzufügen:** Schlüssel im macOS Schlüsselbund registrieren.
|
||||
```zsh
|
||||
ssh-add --apple-use-keychain ~/.ssh/id_ed25519_github
|
||||
|
||||
```
|
||||
|
||||
*(Unter Linux einfach `ssh-add ~/.ssh/id_ed25519_github` verwenden).*
|
||||
|
||||
|
||||
3. **SSH-Config anpassen (~/.ssh/config):** Verknüpft Hosts mit den jeweiligen Keys.
|
||||
Öffne deine SSH-Config:
|
||||
|
||||
```zsh
|
||||
code ~/.ssh/config
|
||||
|
||||
```
|
||||
|
||||
Stelle sicher, dass beide Hosts sauber getrennt eingetragen sind:
|
||||
|
||||
```text
|
||||
# Neuer GitHub-Key
|
||||
Host github.com
|
||||
HostName github.com
|
||||
User git
|
||||
AddKeysToAgent yes
|
||||
UseKeychain yes
|
||||
IdentityFile ~/.ssh/id_ed25519_github
|
||||
|
||||
```
|
||||
|
||||
Speichere mit **Ctrl + O**, **Enter** und schließe mit **Ctrl + X**.
|
||||
|
||||
|
||||
4. **Neuen Public Key auf GitHub hinterlegen:**
|
||||
Kopiere den Public Key in die Zwischenablage:
|
||||
|
||||
```zsh
|
||||
pbcopy < ~/.ssh/id_ed25519_github.pub
|
||||
|
||||
```
|
||||
|
||||
Füge ihn auf **github.com** unter **Settings** → **SSH and GPG keys** → **New SSH Key** ein.
|
||||
|
||||
|
||||
5. **Verbindung testen & Repository klonen:**
|
||||
Teste die Authentifizierung:
|
||||
|
||||
```zsh
|
||||
ssh -T git@github.com
|
||||
|
||||
```
|
||||
|
||||
Sobald `Hi <Username>! You've successfully authenticated...` erscheint, klone das Repo erneut z.B.:
|
||||
|
||||
```zsh
|
||||
git clone git@github.com:[REPO].git
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user