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 pullbefore starting work; commit and push when done. - Divergent branch resolution: When local and remote have diverged, use
git pull --no-rebase(merge) for safety orgit fetch origin && git reset --hard origin/mainto 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 falseOption 2: Rebase (local commits on top of remote)#
git pull --rebase
# Or set as default:
git config pull.rebase trueOption 3: Discard local, use remote only#
git fetch origin
git reset --hard origin/mainOption 4: Fast-forward only (fails if diverged)#
git pull --ff-onlyMulti-Machine Workflow#
When working from multiple machines on the same repo:
- Always
git pullbefore starting new work - Commit and push when done on each machine
- 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 --hardpermanently discards local commits — use only when certain local work is not needed.
Related Pages#
Sources#
ingested/chats/178-Push Git Repository Guide.mdingested/chats/136-Resolving Git Pull Divergence Conflicts Guide.md- DeepSeek conversation: “Resolving Git Pull Divergence Conflicts Guide” (chat 136)