Both Sides Moved
You have commits that origin does not have, and a teammate has pushed commits that you do not have. The team keeps its history in one straight line: no merge commits. Get your commits onto origin, on top of the teammate's.
Example 1
starts as
* 3adce7f (HEAD -> main) my work * b527f18 (origin/main) first commit nothing to commit on origin: dae8e37 the teammate's work b527f18 first commit
ends as
commits on origin, newest first: my work the teammate's work first commit commits, newest first: my work the teammate's work first commit staged: nothing changed, not staged: nothing untracked: nothing
Constraints
- 1 or 2 commits on each side
- 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
- Commits per AuthorHard
- Find and PickHard
- Get Them BackHard
- On Top of MainHard
- Split the CommitHard
- The First Bad CommitHard
- Three Into OneHard
- Undo the MergeHard