Skip to main content
Senior

Git Fetch Arguments

Senior

Task

Download only the foo branch from origin, without updating the other remote branches.

Requirements

  • Explicitly specify the remote origin and the foo branch.
  • Do not run a full fetch of all branches.
  • There is no need to move the local branches.

Expected result

A remote-tracking branch o/foo with the commits of the remote foo must appear in the local repository. main and o/main must stay where they are.

What you will learn

After completing this task you will be able to:

  • run a selective fetch of a single branch;
  • understand which objects and pointers are downloaded;
  • avoid needlessly updating the entire remote.
Goal
localC0C1HEAD main o/mainC2C3o/foo
originC0C1mainC2C3HEAD foo
Git trainer0 commands
terminal
localC0C1HEAD main o/main
originC0C1mainC2C3HEAD foo