PY-1.4-BP1-MQ60

Our Goal: See How Branches Keep Things Separate

In this lesson, you will go back to the main version of your game. You will then check to see if the score limit you added is there. It should not be there! This shows how branches keep your new work separate from the main game until you are ready to put them together.

Check Where You Are

Before you go back to the main game, let's check which branch you are on. You should be on the 'feature/add-score-limit' branch.

Run this command in your terminal:

git branch

What you should see:

āœ… The 'feature/add-score-limit' branch should have a star (*) next to it. This means you are on the branch where you added the score limit.

Go Back to Main and Check

Now, you will go back to the 'main' branch. This is the original, stable version of your game.

Use this command to switch back to the 'main' branch:

git checkout main

After you switch, run your Pong game. Play it for a bit. Does the game stop when a player reaches 5 points? It should not! This shows that the score limit code you wrote is only on your special branch, not on the main game yet.

You can also open the main.py file and look at the code. You should not see the score limit code you added earlier.

Check Your Work Again

You've checked the main game! Now, let's make sure you saw what you were supposed to see.

What you should have seen:

āœ… The game should not stop when a player reaches 5 points. It should keep going. āœ… The main.py file should not have the score limit code you added earlier.

If you saw these things, it means you understand how branches keep your work separate!

Documentation

Documentation not available for PY-1.4-BP1.