Reset the master branch to the point prior to the conflicting commit.
The interactive mode we added to the master branch has become a change conflicting with the changes in the style branch. Let’s revert the changes in the master branch up to the point before the conflict change was made. This allows us to demonstrate the rebase command without having to worry about conflicts.
RUN:
git checkout master
git hist
RESULT:
$ git hist
* 454ec68 2020-01-09 | Life is great! (HEAD, master) [kwikl3arn]
* 6c0f848 2020-01-09 | Added README [kwikl3arn]
* 8029c07 2020-01-09 | Added index.html. [kwikl3arn]
* 567948a 2020-01-09 | Moved hello.html to lib [kwikl3arn]
* 6a78635 2020-01-09 | Add an author/email comment [kwikl3arn]
* fa3c141 2020-01-09 | Added HTML header (v1) [kwikl3arn]
* 8c32287 2020-01-09 | Added standard HTML page tags (v1-beta) [kwikl3arn]
* 43628f7 2020-01-09 | Added h1 tag [kwikl3arn]
* 911e8c9 2020-01-09 | First Commit [kwikl3arn]
The "Added README" commit goes directly before the conflicting interactive mode we added. Right now we need to reset the master branch to the "Added README" branch.
RUN:
git reset --hard <hash>
git hist --all
Examine the log. It should look as if we rewound the repository to a point in time, prior to any mergers.
RESULT:
$ git reset --hard 6c0f848
HEAD is now at 6c0f848 Added README
$ git hist --all
* 6c0f848 2020-01-09 | Added README (HEAD, master) [kwikl3arn]
| * 07a2a46 2020-01-09 | Updated index.html (style) [kwikl3arn
| * 649d26c 2020-01-09 | Hello uses style.css [kwikl3arn]
| * 1f3cbd2 2020-01-09 | Added css stylesheet [kwikl3arn]
|/
* 8029c07 2020-01-09 | Added index.html. [kwikl3arn]
* 567948a 2020-01-09 | Moved hello.html to lib [kwikl3arn]
* 6a78635 2020-01-09 | Add an author/email comment [kwikl3arn]
* fa3c141 2020-01-09 | Added HTML header (v1) [kwikl3arn]
* 8c32287 2020-01-09 | Added standard HTML page tags (v1-beta) [kwikl3arn]
* 43628f7 2020-01-09 | Added h1 tag [kwikl3arn]
* 911e8c9 2020-01-09 | First Commit [kwikl3arn]