1. Learn
  2. /
  3. Courses
  4. /
  5. Advanced Git

Connected

Exercise

Create a worktree

You're working on the feature_branch for the flight data pipeline project, but you need to quickly fix a bug in the main branch without switching branches. You are planning to make the changes in bugfix and want to create a worktree in the ../bugfix directory.

Instructions 1/3

undefined XP
  • 1

    Assume that bugfix branch already exists. Create a new worktree to fix the bug issue named bugfix in the ../bugfix directory.

  • 2

    Change to the new bugfix worktree directory located in ../bugfix. You should move there in one step.

  • 3

    Check which branch you are on in the bugfix worktree directory.