English 中文(简体)
起源于推土机的主人的含义是什么
原标题:What s the meaning of origin in git push origin master
  • 时间:2011-03-11 08:46:42
  •  标签:
  • git

当我跑时:

git push origin master

......在这方面,<代码>原文

最佳回答

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.

问题回答

git有一个“再分配”的概念,即像一个存放处那样容易的镍,因此,在你想提及另一个存放处时,你不必使用全部的URL。

<代码>origin<> /code>只是一个与其他人一样的遥远之处,但你经常看到这一点,因为如果你第一次戴上了存放处,那么<代码>git <>/code>将不停地建立一个称为origin<>/code>的遥远处,以提及你从中穿戴的URL。

如果您填写了<代码>git 边远-v,该编码将显示你在当地存放处所建立的所有边远地点以及他们提到的URLs。 (你们看到,它比我前面说过更为复杂,因为边远可以指不同的URL来推动和挑拨,但你可能不需要担心:)

来源是你从gin上读到该代码的地方。

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 git@github.com:/PROJECT_U

“Origin”是你希望公布承诺的遥远存放处的名称。 通过公约,缺省边际存放处称为“原始”,但可以同时与几个边远者(有不同名称)合作。

Putting it in very simple way, let see where origin comes from. When you first clone your repo from a remote server, or cloud i.e. GitHub, you use either the HTTPS, SSH, or GitHub CLI link to do the cloning. In my example, I use the URL

git clone https://github.com/****/my-first-repo.git

to clone my project. So, the origin of my project is on GitHub, therefore the URL link below that point to my remote repo on GitHub is the origin

https://github.com/****/my-first-repo.git

Using bash CLI if I type git remote -v , I get the same URL as below

$ git remote -v
origin  https://github.com/****/my-first-repo.git (fetch)
origin  https://github.com/****/my-first-repo.git (push)

这一产出证实,如上所述,来源是URL。

现在,如果你想要把你的主子(现在称作主人)推向原产地,而不要使用。

git push https://github.com/****/my-first-repo.git master

简明扼要地使用

git push origin master

Hope this help someone understand the concept.

简单术语:

git push origin master
  1. git: attention computer, the following commands are for the git library, I hope I have it installed.
  2. push: I am going to take my code, and shove it to this Github repo.
  3. origin: The default codename for the repository that keeps my code on my github page. (You know when you did git init, or git clone? It sets up a git storage unit basically, and that storage unit on github, and it has a default identifier as the origin . When you push, all your code goes into this storage thing called the origin.
  4. master: on my repo called origin, grab the main branch, which is called master.

To recap: Hi machine, use github tools to take the code i m working on, and put it online. Put it in the project this repo is part of, that was created on github (called origin), and store it in whatever branch I say, in this case master .





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签