Settle the Conflict
main and feature both changed the one line of mode.txt, so merging feature into main stops with a conflict. You are on main. Do the merge, and settle the conflict by keeping the line of feature. Keep the message Git suggests for the merge.
Example 1
starts as
* 8ce4722 (HEAD -> main) go safe | * 1451532 (feature) go fast |/ * e61d3f3 add notes * 1329ea1 first commit nothing to commit mode.txt on main: mode=safe mode.txt on feature: mode=fast
ends as
on branch: main commits, newest first: Merge branch 'feature' (a merge) go fast go safe add notes first commit mode.txt: mode=fast staged: nothing changed, not staged: nothing untracked: nothing
Constraints
mode.txthas one line- Each branch may have changed other files too: those merge by themselves
Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.
More Git problems
- Since the ReleaseMedium
- Take Back the CommitMedium
- Two Lines of WorkMedium
- Undo With a New CommitMedium
- An Older CommitHard
- Both Sides MovedHard
- Commits per AuthorHard
- Find and PickHard