PY-1.4-BP1-MQ80

Our Goal: Clean Up Your Branches

In this lesson, you will learn how to clean up your Git branches. After you've put your new feature into the main game, you don't always need the special branch you made for it. You will delete the 'feature/add-score-limit' branch to keep your project tidy. You will also get ready to tell someone about all the steps you took to add your new feature.

Check What You Have

Before you delete the branch, let's check to make sure it's still there. You should see the 'feature/add-score-limit' branch in your list.

Run this command in your terminal:

git branch

What you should see:

āœ… You should see 'feature/add-score-limit' in the list. This means it's ready to be cleaned up!

Delete Your Branch

Now that your new feature is in the main game, you can delete the special branch you made for it. This helps keep your project neat and tidy.

Use this command to delete a branch. Here's an example of how to delete a branch called 'old-feature':

git branch -d old-feature

Make sure you are on the 'main' branch before you delete your 'feature/add-score-limit' branch.

Check Your Work Again

You've deleted your branch! Now, let's check to make sure it's gone.

Run this command in your terminal:

git branch

What you should see:

āœ… The 'feature/add-score-limit' branch should not be in the list anymore. This means you successfully cleaned up your branches!

What You Learned

Great job! You finished the whole process of adding a new feature using branches.

You learned:

  • Why it's good to use branches.
  • How to make a new branch and move to it.
  • How to save your work on that branch.
  • How to bring your new work into the main game.
  • How to clean up by deleting your branch.

Now you can tell someone all about how you added your new feature!

Documentation

Documentation not available for PY-1.4-BP1.