Skip to content

Who am I?


Setup

After mediocre success with your app Who are you?, you decide to build a more introspective version - Who am I? 🧐

Run the following commands to set up a git repo with some modifications for your app.

cd path/to/parent/dir/
mkdir who-am-i
cd who-am-i
git init
echo "# Who are you?" > README.md
echo "The app that recalls someone's name when your brain cannot" >> README.md
git add README.md
git commit -m "added README"
echo "python-3.10.7" > runtime.txt
git add runtime.txt
git commit -m "added runtime.txt"
echo "python-3.10.8" > runtime.txt
git add runtime.txt
git commit -m "upgraded python to 3.10.8"
path/to/parent/dir/
  who-am-i/
    README.md
    runtime.txt
bill@gates:who-are-you$ git status
On branch main
nothing to commit, working tree clean

In this example, you

  1. committed README.md
  2. committed runtime.txt
  3. changed and re-committed runtime.txt

Thus you've made three total commits, as shown by git log.

bill@gates:who-are-you$ git log --oneline
8e13883 (HEAD -> main) upgraded python to 3.10.8
4d482ad added runtime.txt
7e37646 added README

At this point, you realize your code is broken 🤨 probably due to updating your Python version in the latest commit..

Challenge

Restore runtime.txt back to the way it was before your latest change. (Use git commands - don't just edit the file!)