PY-1.4-BP1-MQ50

Our Goal: Save Your Work

In this lesson, you will learn how to save the changes you made to your game. This is like saving your progress in a game, but for your code! You will save the score limit code to your 'feature/add-score-limit' branch. You will also learn how to write a good message about what you changed.

Check What You Have

Before you save your changes, let's see what Git knows about your files. You should have changed the main.py file to add the score limit.

Run this command in your terminal:

git status

What you should see:

āŒ You should see main.py listed as a changed file. This means Git knows you've made changes and you're ready to save them!

Save Your Changes

Now it's time to save your changes! This is a two-step process in Git:

First, you need to 'stage' your changes. This is like putting the files you want to save into a special box. You can stage all changed files with this command:

git add .

After staging, you need to 'commit' your changes. This is like putting a label on the box that says what you changed. You also write a message about what you did. Here's an example:

git commit -m "Add a new feature"

Make sure your message tells what you added, like 'Add score limit to end game'.

Check Your Work Again

You've saved your changes! Now, let's check to make sure everything is saved correctly.

Run this command in your terminal:

git status

What you should see:

āœ… It should say 'nothing to commit, working tree clean'. This means all your changes are saved.

Then, run this command to see your save history:

git log --oneline

What you should see:

āœ… You should see your new save message at the top of the list. This means your feature is saved on your branch!

Documentation

Documentation not available for PY-1.4-BP1.