Skip to main content
Senior

Remote Branches

Senior

Task

Start from the remote branch o/main, create a separate branch bugFix, add a commit to it, and publish it to origin.

Steps

  1. Create a local branch bugFix from o/main and switch to it.
  2. Make one commit.
  3. Push the resulting branch to the remote repository.

Expected result

The local and remote bugFix branches must point to the new commit. HEAD must be on the local bugFix.

What you will learn

After completing the task, you will be able to:

  • create a local branch from a remote-tracking branch;
  • publish a new branch to origin;
  • understand how the tracking relationship is set up after a push.
Goal
localC0C1main o/mainC2HEAD bugFix o/bugFix
originC0C1HEAD mainC2bugFix
Git trainer0 commands
terminal
localC0C1HEAD main o/main
originC0C1HEAD main