benthayer / git-gud

Wanna git gud? Then get git-gud, and git gud at git!
MIT License
401 stars 42 forks source link

Level: Basics 8 - "DIY Merge Conflicts" #251

Open benthayer opened 3 years ago

benthayer commented 3 years ago
DIY Merge Conflicts

This level to show several things and to continue getting people comfortable with adding/modifying and committing files. It also introduces the command for branching.

For branching, we'll need to specify

The idea behind the level is to use branches to tell two stories and then try merging them together to get merge conflicts. This is similar to #250, but the storytelling is done by the user.

The level would go something like this:

Overview: Using one file and two branches, tell about a character's adventures, then merge them together, resolving the merge conflicts so you can read the whole story. One adventure can go on master and the other adventure can be on another branch

git gud status

Initial Commit
story.txt:
Once upon a time, there was a grumpy old troll.

Add an Adventure to the Story
story.txt:
Once upon a time, there was a grumpy old troll.
He lived under a bridge.

Add a Second Adventure and an Ending
story.txt:
Once upon a time, there was a grumpy old troll.
He was having a bad hair day.

Merge in the second adventure
story.txt:
Once upon a time, there was a grumpy old troll.
He lived under a bridge.
He was having a bad hair day.
benthayer commented 3 years ago

Alternatively, we can keep the format (adding text to the end of the same file via two branches) and have some other theme. We could have someone's name and two character traits. That would be simpler for the user. Other options are possibly good too.

sahansk2 commented 3 years ago

@benthayer Yoop