Skip to main content
Senior

Git Push Arguments 2

Senior

Task

Push the contents of the local foo branch to the main branch on origin, explicitly giving different names for the source and the destination.

Requirements

  • The source must be the local foo branch.
  • The destination must be the remote main branch.
  • Use a refspec in the form source:destination.

Expected result

The remote main and the local pointer o/main must move to the commit of the foo branch. The local main branch must not move.

What you will learn

After completing this task you will be able to:

  • read and write refspecs for push;
  • push a local branch under a different remote name;
  • distinguish the source from the destination of a push.
Goal
localC0C1mainC2HEAD foo o/main
originC0C1C2HEAD main
Git trainer0 commands
terminal
localC0C1main o/mainC2HEAD foo
originC0C1HEAD main