sync working, files from desktop added, next files from laptop and update index.md
This commit is contained in:
parent
02e9361d8c
commit
e6cb2ecf99
2 changed files with 58 additions and 0 deletions
18
git_basics.md
Normal file
18
git_basics.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Git Basics
|
||||
|
||||
## git push — remote vs branch syntax
|
||||
|
||||
**Problem:** `git push -u main` throws:
|
||||
fatal: 'main' does not appear to be a git repository
|
||||
fatal: Could not read from remote repository.
|
||||
|
||||
**Diagnosis:** Git expected a remote name but got a branch name.
|
||||
|
||||
**Fix:**
|
||||
git push -u origin main
|
||||
|
||||
**Key insight:** The syntax is always remote first, branch second.
|
||||
`origin` = where to push (the remote repository)
|
||||
`main` = which branch to push
|
||||
`-u` = sets origin/main as the default tracking branch,
|
||||
so future pushes only need `git push`
|
||||
40
ssh_keys_and_agent.md
Normal file
40
ssh_keys_and_agent.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# SSH Keys & Agent
|
||||
|
||||
## SSH Keypair — per device setup
|
||||
|
||||
**Problem:** No SSH key exists on the device yet.
|
||||
**Fix:**
|
||||
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
|
||||
**Key insight:** One keypair per device — not per service. Private key never leaves the machine. Public key goes to the server/Forgejo/GitHub.
|
||||
|
||||
---
|
||||
|
||||
## ~/.ssh/config — Host entry with Port
|
||||
|
||||
**Problem:** Forgejo runs on a non-standard port (e.g. 2222) — SSH doesn't know that by default.
|
||||
**Fix:**
|
||||
Host git.bujour.de
|
||||
HostName git.bujour.de
|
||||
User git
|
||||
Port 2222
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
**Key insight:** Port gets its own line in the config — not appended to HostName.
|
||||
|
||||
---
|
||||
|
||||
## ssh-agent + ssh-add
|
||||
|
||||
**Problem:** SSH asks for passphrase on every push/pull.
|
||||
**Symptom:** `Could not open a connection to your authentication agent.`
|
||||
**Diagnosis:** Agent isn't running yet.
|
||||
**Fix:**
|
||||
eval "$(ssh-agent -s)"
|
||||
ssh-add ~/.ssh/id_ed25519
|
||||
**Key insight:** `ssh-agent` must be started first with `eval "$(ssh-agent -s)"` before `ssh-add` works. Agent only lives for the current session — needs autostart via `.bashrc` or `.profile` (TODO).
|
||||
|
||||
---
|
||||
|
||||
## Forgejo SSH authentication — success message
|
||||
|
||||
**Problem/Confusion:** After `ssh -T git@git.bujour.de` the response says "Forgejo does not provide shell access" — looks like an error.
|
||||
**Key insight:** This is the success message. Forgejo (like GitHub) intentionally blocks interactive shell sessions. "Successfully authenticated" in the same message confirms it worked.
|
||||
Loading…
Add table
Reference in a new issue