我用于提交的默认 git 存储库是什么?
如果我输入 git remote -v 我会得到一些 git 存储库:
origin [email protected]:me/MyProject.git (fetch)
origin [email protected]:me/MyProject.git (push)
testheroku [email protected]:test.git (fetch)
testheroku [email protected]:test.git (push)
upstream git://github.com:me/MyProject.git (fetch)
upstream git://github.com:me/MyProject.git (push)
我刚刚在 README 文件上运行了“git commit”,并希望这会更新 MyProject.git 上的文件 - 这似乎不是案件。我错了吗?
另外,有人可以澄清什么是上游吗?这是否意味着我领先于一个分支或者到底是什么?
谢谢, 齿轮。
If I type git remote -v I get a number of git repos:
origin [email protected]:me/MyProject.git (fetch)
origin [email protected]:me/MyProject.git (push)
testheroku [email protected]:test.git (fetch)
testheroku [email protected]:test.git (push)
upstream git://github.com:me/MyProject.git (fetch)
upstream git://github.com:me/MyProject.git (push)
I've just done ran "git commit" on the README file and would have expected this to update the file on MyProject.git - this does not appear to be the case. Am I wrong?
Also, can somebody clarify what upstream is? Does it mean I'm ahead of a branch or what exactly?
Thanks,
Gearoid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
提交是本地的。你需要推动他们。
如果您一直这样做,则可以设置默认值以决定将更改推送到哪些遥控器。然后,您就可以
根据您的配置,从任何分支进行的更改将上升到任何远程。第一次推送时,您可以
设置该分支,以自动包含该分支以推送到该存储库。后续
将相当于
要更熟悉,请查看
此外,您可能不需要最后一个遥控器。你可以摆脱它
希望这会有所帮助
Commits are local. You need to push them.
If you do this all the time, you can set up defaults as to which remotes the changes will be pushed. Then you can just
and your changes from any branches will go up to any remotes depending on your configuration. The first time you push, you can
and this will set up that branch to automatically be included for pushing to that repository. A subsequent
will be equivelant to
To get more familiar, take a look at
Also, you probably don't need the last remote. You can get rid of it with
Hope this helps
当您提交时,您将提交到本地存储库。每个 git 工作目录都有一个关联的存储库。
origin、testheroku 和上游都是您可以轻松推送和拉取的遥控器(您也可以显式使用未列出的存储库)。
如果您这样做:
它可能会(取决于配置)自动推送到
origin
的master
分支。此外,第一个和第三个似乎是相同的存储库,只是具有不同的 URL。
您还可以根据需要在本地创建分支,但这是另一个主题。
When you commit, you're committing to your local repository. Every git working directory has an associated repo.
origin, testheroku, and upstream are all remotes you can easily push and pull from (you can also explicitly use a repo not listed).
If you do:
it will probably (depending on configuration) push to
origin
'smaster
branch automatically.Also, the first and third appear to to be the same repos, just with different URLs.
You can also create branches as needed locally, but that's a different topic.
git remote -v show
显示有关您的遥控器的有趣信息gitbranch -vv
命令将向您显示特定分支的上游,可能默认情况下推送到的位置。然而,当你说 git push 时, git configbranch.master.remote 是唯一确定你推送到哪里的绝对方法。
git remote -v show
shows interesting information about your remotesThe
git branch -vv
command will show you your upstream for a specific branch which is probably where you push to by default.However
git config branch.master.remote
would be the only absolute method to know for sure where you push to when you saygit push