Git Push Arguments
Task
HEAD is currently on the foo branch. Without switching away from it, push the local main branch to the branch of the same name on origin.
Requirements
- Explicitly specify the remote
originand the local branchmain. - Do not publish the
foobranch. - Do not switch
HEADtomain.
Expected result
The remote main and o/main must move to the local main commit, and HEAD must stay on foo.
What you will learn
After completing this task you will be able to:
- push a branch that is not the current one;
- explicitly specify the source for push;
- separate the position of
HEADfrom the reference being published.
Goal
local
origin