Welcome to our "Exquisite Corpse" style collaborative story writing game using Git! In this activity, each participant will add to a story with a hint left in the commit message, maintaining the element of surprise.
To avoid participants prematurely seeing the story file and ruining their surprise, we will use the echo command in a Git Bash terminal to add our lines to the story. The -e flag enables interpretation of backslash escapes, so at the end of our addition we can add a \n newline character to keep our story formatting nice and tidy. The >> operator appends the new addition to the file.
-
Write the first part of the story in
story.txt
:echo -e "Our story is going to be great and stuff is going to happen. Suddenly, something happened... \n" >> story.txt
-
Commit and push:
git status git add story.txt git status git commit -m "Suddenly, something happened..." git status git push origin main
-
Pull changes:
git pull origin main
-
Check the commit message hint:
git log --oneline -1
- Suddenly, something happened...
-
Write the next part of the story in
story.txt
:echo -e "Blah blah blah and etc...\n" >> story.txt
-
Commit and push:
git status git add story.txt git status git commit -m "and etc..." git status git push origin main
-
Pull changes:
git pull origin main
-
Check the commit message hint:
git log --oneline -1
- and etc...
-
Write the next part of the story in
story.txt
:echo -e "Blah blah blah and etc...\n" >> story.txt
-
Commit and push:
git status git add story.txt git status git commit -m "and etc..." git status git push origin main
-
Once every participant has had a couple of turns, we can pull all changes and read the story:
git pull origin main cat story.txt