简体   繁体   English

如何设置 NetBeans 7 以下载 GitHub 存储库的内容?

[英]How do I set up NetBeans 7 to download the contents of a GitHub repository?

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 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:我已经为要创建的存储库初始化了一个根路径,然后输入了 URI,但是当我单击 Fetch 时,我得到的只是:

==[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 (ie apparently empty):这听起来很有希望,除了在 NetBeans 中,存储库看起来像这样(即显然是空的):

在此处输入图像描述

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?如何从存储库中获取文件(我只想在本地编辑它们,但始终拥有可用的最新版本——不提交任何内容)并在 C++ 项目中使用它们?

Again, apologies for the newb question.再次为 newb 问题道歉。 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.尽管过去运行 SVN 和 SourceSafe 版本控制没有问题,但我似乎找不到任何启动和运行的指南。

Thanks.谢谢。

When you "fetch", you only populate the "remotes" part of the refs (references) of your empty Git repo.当您“获取”时,您只填充空 Git 存储库的参考(参考)的“远程”部分。
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. Git 的此视觉参考,以了解 git 获取如何不修改本地文件。

获取

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.另一种选择是直接克隆repo。

git 克隆

Your local repo wouldn't be empty, and would be set up right away on a branch (generally by default master ).您的本地仓库不会为空,并且会立即在分支上设置(通常默认为master )。

The answer is simply: You need to pull or clone a repository.答案很简单:您需要pullclone存储库。 Sadly you can presently do neither in NetBeans.可悲的是,您目前不能在 NetBeans 中执行任何操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM