什么是“原产地”?在Git中? [英] What is "origin" in Git?

查看:172
本文介绍了什么是“原产地”?在Git中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行时:

  git push origin branchname 

原因是 origin ,为什么必须在分支名称前输入它?

解决方案原始是系统上的别名 / em>为特定的远程存储库。它实际上不是该存储库的一个属性。



通过做

  git push origin branchname 

你说要推送到原点 code>存储库。没有要求命名远程仓库 origin :事实上,同一个仓库可以为另一个开发人员使用不同的别名。



<远程是一个别名,用于存储存储库的URL。您可以通过使用

  git remote -v 

推送命令中,您可以使用遥控器,也可以直接使用 URL 即可。一个使用URL的例子:

  git push git@github.com:git / git.git master 


When I run:

git push origin branchname

What exactly is origin and why do I have to type it before the branch name?

解决方案

origin is an alias on your system for a particular remote repository. It's not actually a property of that repository.

By doing

git push origin branchname

you're saying to push to the origin repository. There's no requirement to name the remote repository origin: in fact the same repository could have a different alias for another developer.

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. An example that uses the URL:

git push git@github.com:git/git.git master

这篇关于什么是“原产地”?在Git中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆