What is “origin” in Git?

What is “origin” in Git?

origin is the original(原始的,最初的) remote repository, by convention(惯例,习俗) it is the 'primary' centralized repository as well.

By saying git push origin branchname you're saying to push to the origin repository. There's no requirement to name the remote repository origin, and there can be multiple remote repositories.

Remotes are simply an alias that store the url of repositories. You can see what url belongs to each remote by using git remote -v. In the push command you can use remotes or you can simply use a url directly (e.g. git push [email protected]:git/git.git master).


通过git remote -v命令查看远程仓库

origin——远程仓库的别名,如下显示的

Lenovo@LENOVO-PC /c/WorkSpace5-gitosc/Graduation-Thesis (testing)
$ git remote -v
origin  https://git.oschina.net/xinxingegeya/Graduation-Thesis.git (fetch)
origin  https://git.oschina.net/xinxingegeya/Graduation-Thesis.git (push)

如上所示,origin 表示 https://git.oschina.net/xinxingegeya/Graduation-Thesis.git 远程仓库 。

============================END============================

你可能感兴趣的:(What is “origin” in Git?)