如何设置 NetBeans 7 以下载 GitHub 存储库的内容?
对于我的问题的新颖性表示歉意。我想连接并下载 GitHub 存储库的内容,特别是: https://github.com/residual/残差(存储库 URI 为:https://github.com/residual/residual.git)。
我已经初始化了要创建的存储库的根路径,然后输入 URI,但是当我单击“获取”时,我得到的只是:
==[IDE]== 21-Jul-2011 23:02:51 Connecting
==[IDE]== 21-Jul-2011 23:02:51 Connecting finished.
==[IDE]== 21-Jul-2011 23:05:29 Fetching...
git fetch https://github.com/residual/residual.git +refs/heads/master:refs/remotes/origin/master
No update
==[IDE]== 21-Jul-2011 23:05:30 Fetching... finished.
这听起来很有希望,但在 NetBeans 中,存储库看起来像这样(即显然是空的):
如何从存储库获取文件(我只想在本地编辑它们,但始终拥有最新版本可用——不提交任何内容)并使用它们在 C++ 项目中?
再次对新问题表示歉意。尽管过去运行 SVN 和 SourceSafe 版本控制没有任何问题,但我似乎找不到任何启动和运行它的指南。
谢谢。
Apologies for the newbishness of my question. I would like to connect and download the contents of a GitHub repository, specifically: https://github.com/residual/residual (with the repository URI being: https://github.com/residual/residual.git).
I have initialized a Root Path for the repository to be created, and then fed in the URI, but when I click Fetch, all I get is:
==[IDE]== 21-Jul-2011 23:02:51 Connecting
==[IDE]== 21-Jul-2011 23:02:51 Connecting finished.
==[IDE]== 21-Jul-2011 23:05:29 Fetching...
git fetch https://github.com/residual/residual.git +refs/heads/master:refs/remotes/origin/master
No update
==[IDE]== 21-Jul-2011 23:05:30 Fetching... finished.
Which sounds promising except in NetBeans the repository looks like this (i.e. apparently empty):
How do I get the files from the repository (I only want to edit them locally, but always have the latest version available -- not commit anything) and use them in a C++ project?
Again, apologies for the newb question. I can't seem to find any guides to getting this up and running, despite having had no problems running SVN and SourceSafe version control in the past.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您“获取”时,您仅填充空 Git 存储库的 refs(引用)的“远程”部分。
换句话说,您不会修改任何本地文件(您现在没有这些文件,因为您的存储库是空的)
Cf。这个 Git 的可视化参考,以便了解 git fetch 如何不修改本地文件。
获取后,您需要根据刚刚获取的远程分支之一签出分支。
另一种选择是直接克隆存储库。
您的本地存储库不会为空,并且会立即在分支上设置(通常默认情况下 <代码>主控)。
When you "fetch", you only populate the "remotes" part of the refs (references) of your empty Git repo.
In other words, you don't modify any of your local files (which you don't have for now, since your repo is empty)
Cf. this visual reference for Git, in order to see how git fetch does not modify the local files.
Once fetched, you need to checkout a branch based on one of the remotes branches you have just fetched.
Another option would have been to clone directly the repo.
Your local repo wouldn't be empty, and would be set up right away on a branch (generally by default
master
).答案很简单:您需要
拉取
或克隆
存储库。遗憾的是,目前在 NetBeans 中您无法执行这两项操作。The answer is simply: You need to
pull
orclone
a repository. Sadly you can presently do neither in NetBeans.