What does "origin" mean here?
That refers to a remote in your local repository. A remote is a label for a remote repository, and is created either implicitly when you run git clone
or explicitly when you run git remote add
.
A repository can have multiple remotes (for example, you will often have a remote referring to the upstream version of some code and another referring to your own remote fork of that repository).
In my perspective, "git push remote-branch" should do the job, since git should understand that i want to push the currently checked branch i.e "local-branch" to "remote-branch".
If you haven't previously set up tracking information (either implicitly, by checking out a remote branch locally, or explicitly, using git push -u ...
), then you need to tell git where to push your branch.
When you git push origin local-branch
, you are telling git
to push your local branch named local-branch
to a remote branch of the same name hosted at origin
.