Pick the Latest
The branch experiments holds several commits, and only its latest one is wanted on main. You are on main. Copy that one commit onto it; the rest of experiments stays where it is.
Example 1
starts as
* 2b3bb39 (experiments) the good one * 782f1b4 try two * c30e70d try one * b527f18 (HEAD -> main) first commit nothing to commit
ends as
on branch: main commits, newest first: the good one first commit files in the latest commit: a.txt fix.txt
Constraints
experimentshas 2 to 4 commits of its own- Each of them added a file of its own
Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.
More Git problems
- Publish the BranchMedium
- Settle the ConflictMedium
- Since the ReleaseMedium
- Take Back the CommitMedium
- Two Lines of WorkMedium
- Undo With a New CommitMedium
- An Older CommitHard
- Both Sides MovedHard