What is Origin?
Goals
- Learn about naming remote repositories.
Execute:
git remote
Output:
$ git remote
origin
We see that the cloned repository knows about a remote repository named origin. Let’s see if we can get more information about origin:
Execute:
git remote show origin
Output:
$ git remote show origin
warning: more than one branch.master.remote
* remote origin
Fetch URL: /Users/jim/Downloads/git_tutorial/work/hello
Push URL: /Users/jim/Downloads/git_tutorial/work/hello
HEAD branch: master
Remote branches:
greet tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
and with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
Now we see that the remote repository “origin” is simply the original hello repository. Remote repositories typically live on a separate machine, possibly a centralized server. As we can see here, however, they can just as well point to a repository on the same machine. There is nothing particularly special about the name “origin”, however the convention is to use the name “origin” for the primary centralized repository (if there is one).
当前内容版权归 gitimmersion 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 gitimmersion .