O'Reilly logo

Professional Git by Brent Laster

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connected Lab 10

Working with Worktrees

In this lab, you’ll get some experience with worktrees. For this and the subsequent labs, I have split the calc2 repository that you used in the last lab into three separate projects.

PREREQUISITES

This lab requires that you have Internet access and have completed Connected Lab 8: Setting up a GitHub Account and Cloning a Repository. You will be working in a new directory.

STEPS

  1. For this lab, you need access to your GitHub account that you set up in Connected Lab 8. I have split up the calc2 project you used in Connected Lab 9 into three separate projects: super_calc, a version of the calc2 project with only the master and feature branches; sub_ui, a separate repository consisting of only the content of the ui branch split out from the calc2 project; and sub_docs, a separate repository consisting of only the content of the docs branch split out from the calc2 project. Log in to your GitHub account and fork the three projects from the following listed locations. (As a reminder, the fork button is in the upper-right corner of the pages.) This will prepare your area on GitHub for doing this lab, as well as Connected Labs 11 and 12.

    https://github.com/professional-git/super_calc.githttps://github.com/professional-git/sub_ui.git https://github.com/professional-git/sub_docs.git

  2. In a new directory, clone down the super_calc project that you forked in step 1, using the following command:
    $ git clone https://github.com/<your github userid>/super_calc.git ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required