Skip to main content
Senior

Locked Main

Senior

Task

Publishing directly to main is forbidden. Create a separate branch for the change and push only that branch.

Steps

  1. Create a branch named exactly feature from the current state.
  2. Make one commit on it.
  3. Publish the feature branch to origin.

Expected result

The local and remote feature must point to the new commit. The local main, o/main and the remote main must stay unchanged.

What you will learn

After completing this task you will be able to:

  • work through a feature branch when main is protected;
  • publish a new branch without touching the main one;
  • understand the basic workflow for a subsequent pull request.
Goal
localC0C1main o/mainC2HEAD feature o/feature
originC0C1HEAD mainC2feature
Git trainer0 commands
terminal
localC0C1HEAD main o/main
originC0C1HEAD main