Mastering Git branch navigation

Report a typo

You are working on a repository that contains three branches: main, feature, and hotfix. Your task is to use the Git checkout command to navigate between these branches and verify the branch transitions. Additionally, you must use Git shorthand commands as part of your solution. Note that the current branch is main.

Please perform the following steps:

  • Switch to the feature branch from the main branch;

  • Switch to the hotfix branch from the feature branch;

  • Use a shorthand command to switch back to the previous branch twice in a row;

  • Use a shorthand command to switch back to the previous branch again;

  • Use a shorthand command to switch directly to the main branch;

Ensure to navigate through all the branches in the correct sequence.

Write all the commands below one command per line.

Write a program
# Write your solution below
# Ensure to type the commands line by line

Create a free account to access the full topic