//nbkelley /homelab

Git Push Authentication#

What Was Established#

Patterns for resolving Git push authentication issues and handling divergent branches when working across multiple machines.

Key Decisions#

  • Multi-machine workflow: Always git pull before starting work; commit and push when done.
  • Divergent branch resolution: When local and remote have diverged, use git pull --no-rebase (merge) for safety or git fetch origin && git reset --hard origin/main to discard local commits for remote-only state.

Resolving Divergent Branches#

Symptom#

hint: You have divergent branches and need to specify how to reconcile them.
fatal: Need to specify how to reconcile divergent branches.

Option 1: Merge (preserves both histories)#

git pull --no-rebase
# Or set as default:
git config pull.rebase false

Option 2: Rebase (local commits on top of remote)#

git pull --rebase
# Or set as default:
git config pull.rebase true

Option 3: Discard local, use remote only#

git fetch origin
git reset --hard origin/main

Option 4: Fast-forward only (fails if diverged)#

git pull --ff-only

Multi-Machine Workflow#

When working from multiple machines on the same repo:

  1. Always git pull before starting new work
  2. Commit and push when done on each machine
  3. Set a default pull strategy: git config --global pull.rebase true

Historical Notes#

  • Conversation date: 2025-12-15.
  • Context: Mac local machine pushing to GitHub for nbkelleyhelp repo.
  • git reset --hard permanently discards local commits — use only when certain local work is not needed.

Sources#

  • ingested/chats/178-Push Git Repository Guide.md
  • ingested/chats/136-Resolving Git Pull Divergence Conflicts Guide.md
  • DeepSeek conversation: “Resolving Git Pull Divergence Conflicts Guide” (chat 136)