What's the meaning of 'origin' in 'git push origin master'

Git

Git Problem Overview


When I run:

git push origin master

...what is the meaning of origin in this context?

Git Solutions


Solution 1 - Git

git has a concept of "remotes" - these are like easy nicknames for a repository, so you don't have to use its full URL every time you want to refer to another repository.

origin is just a remote like any other, but you see it very frequently since when you clone a repository for the first time, git clone will by default set up a remote called origin to refer to the URL that you cloned from.

If you do git remote -v that will show you all the remotes you have set up in your local repository, and the URLs that they refer to. (You'll see that it's a bit more complex than I said above, in that a remote can refer to a different URL for pushing and fetching, but you probably don't need to worry about that. :))

Solution 2 - Git

origin is the default name of the remote git repository you cloned from. Have a look at .git/refs/remotes/origin/* and .git/config within your sources to see how git knows about it.

Solution 3 - Git

The origin is where you got the code from origin-ally.

Solution 4 - Git

This would be help

https://www.git-tower.com/learn/git/glossary/origin

n Git, "origin" is a shorthand name for the remote repository that a project was originally cloned from. More precisely, it is used instead of that original repository's URL - and thereby makes referencing much easier.

Note that origin is by no means a "magical" name, but just a standard convention. Although it makes sense to leave this convention untouched, you could perfectly rename it without losing any functionality.

In the following example, the URL parameter to the "clone" command becomes the "origin" for the cloned local repository:

git clone https://github.com/gittower/git-crash-course.git

Solution 5 - Git

origin is remote created by the git itself when you for the first clone the repo to point the URL from which you created the clone. eg: origin [email protected]:/PROJECT_U

Solution 6 - Git

"Origin" is the name of the remote repository where you want to publish your commits. By convention, the default remote repository is called "origin," but you can work with several remotes (with different names) at the same time.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionIckhyun KwonView Question on Stackoverflow
Solution 1 - GitMark LongairView Answer on Stackoverflow
Solution 2 - GitskuroView Answer on Stackoverflow
Solution 3 - GitlivingtechView Answer on Stackoverflow
Solution 4 - GitDeeksha SharmaView Answer on Stackoverflow
Solution 5 - GitNishant DwivediView Answer on Stackoverflow
Solution 6 - GittRuEsAtMView Answer on Stackoverflow