On Top of Main
feature split off from main a while ago, and main has gained commits since. You are on feature. Replay its commits on top of the latest main, so that the history of feature is one straight line with no merge in it. main itself does not move.
Example 1
starts as
* 44cb55a (main) meanwhile on main | * 5149107 (HEAD -> feature) finish the feature | * ca137af start the feature |/ * b527f18 first commit nothing to commit
ends as
on branch: feature commits, newest first: finish the feature start the feature meanwhile on main first commit commits on main, newest first: meanwhile on main first commit
Constraints
featurehas 1 to 3 commits of its own,main1 or 2 newer ones- They changed different files
Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.
More Git problems
- Split the CommitHard
- The First Bad CommitHard
- Three Into OneHard
- Undo the MergeHard
- When Was It AddedHard
- A New BranchBeginner
- Back to MainBeginner
- Commit the ChangeBeginner