brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
resolve-git-conflictsResolve merge + rebase conflicts w/ safe recovery. ID conflict sources, read markers, choose resolution strategies, continue or abort safely. Use → git merge/rebase/cherry-pick/stash pop reports conflicts, git pull conflicts, safely abort + restart failed merge/rebase.
Independent GitHub snapshot · Automated classification · Original documentation governs
ID, resolve, recover from merge + rebase conflicts.
git merge or git rebase reports conflictsgit cherry-pick can't apply cleanlygit pull → conflictsgit stash pop conflicts w/ working treeDetermine what op caused conflict:
# Check current status
git status
# Look for indicators:
# "You have unmerged paths" — merge conflict
# "rebase in progress" — rebase conflict
# "cherry-pick in progress" — cherry-pick conflict
Status output tells which files have conflicts + active op.
→ git status shows files under "Unmerged paths" + indicates active op.
If err: git status clean tree but expected conflicts → op may have completed/aborted. Check git log recent activity.
Open each conflicting file + locate markers:
<<<<<<< HEAD
// Your current branch's version
const result = calculateWeightedMean(data, weights);
=======
// Incoming branch's version
const result = computeWeightedAverage(data, weights);
>>>>>>> feature/rename-functions
<<<<<<< HEAD to =======: Your current branch (or rebasing onto)======= to >>>>>>>: Incoming changes (merging branch or applying commit)→ Each conflicting file has 1+ blocks w/ <<<<<<<, =======, >>>>>>> markers.
If err: no markers found but files conflicting → may be binary or deleted-vs-modified. Check git diff --name-only --diff-filter=U for full list.
Manual merge (most common): Edit file to combine both changes logically, remove all markers.
Accept ours (keep current branch):
# For a single file
git checkout --ours path/to/file.R
git add path/to/file.R
# For all conflicts
git checkout --ours .
git add -A
Accept theirs (keep incoming):
# For a single file
git checkout --theirs path/to/file.R
git add path/to/file.R
# For all conflicts
git checkout --theirs .
git add -A
→ After resolution, file has correct merged content w/ no remaining markers.
If err: chose wrong side → re-read conflicting ver from merge base. During merge, git checkout -m path/to/file re-creates markers so you can try again.
After editing each file:
# Stage the resolved file
git add path/to/resolved-file.R
# Check remaining conflicts
git status
Repeat for every file under "Unmerged paths".
→ All files move "Unmerged paths" → "Changes to be committed". No markers remain.
If err: git add fails or markers remain → re-open file + ensure all <<<<<<<, =======, >>>>>>> lines removed.
Once all resolved:
For merge:
git commit
# Git auto-populates the merge commit message
For rebase:
git rebase --continue
# May encounter more conflicts on subsequent commits — repeat steps 2-4
For cherry-pick:
git cherry-pick --continue
For stash pop:
# Stash pop conflicts don't need a continue — just commit or reset
git add .
git commit -m "Apply stashed changes with conflict resolution"
→ Op completes. git status shows clean tree (or moves to next commit during rebase).
If err: continue cmd fails → check git status for remaining unresolved. All conflicts must resolve before continuing.
Resolution too complex or wrong approach → abort safely:
# Abort merge
git merge --abort
# Abort rebase
git rebase --abort
# Abort cherry-pick
git cherry-pick --abort
→ Repo returns to state before op started. No data loss.
If err: abort fails (rare) → check git reflog to find commit before op + git reset --hard <commit> to restore. Use w/ caution — discards uncommitted.
After op completes:
# Verify clean working tree
git status
# Check that the merge/rebase result is correct
git log --oneline -5
git diff HEAD~1
# Run tests to confirm nothing is broken
# (language-specific: devtools::test(), npm test, cargo test, etc.)
→ Clean tree, correct merge history, tests pass.
If err: tests fail after resolution → merge may have introduced logical errs even though syntax conflicts resolved. Review diff carefully + fix.
<<<<<<<, =======, >>>>>>>) remaingit status shows clean treegit log--ours/--theirs discards other side entirely. Only use when certain one ver completely correct.--amend unless step specifically calls for it. Use git rebase --continue instead.git rebase --abort + git merge --abort discard all resolution work. Only abort to start over.commit-changes — committing after resolutionmanage-git-branches — branch workflows leading to conflictsconfigure-git-repository — repo setup + merge strategies