在我的项目,该项目采用的NuGet使用github上 [英] Using github on my project that uses NuGet

查看:1471
本文介绍了在我的项目,该项目采用的NuGet使用github上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个名为防爆pressForms开源.NET的Web开发框架。我刚才上载该项目Github上: https://github.com/DanielLangdon/Ex$p$ pssForms 的。

I'm creating an open-source .net web development framework called "ExpressForms". I just now uploaded the project to github: https://github.com/DanielLangdon/ExpressForms.

我用的NuGet设置我的code与ASP.net MVC和实体框架的最新版本上运行;这些被保存在溶液下面一个包的目录。我可以看到,默认情况下,git的忽略这个目录上传我的项目github上的时候。

I used NuGet to set up my code to run with the latest versions of ASP.net MVC and Entity Framework; these are saved in a "packages" directory below the solution. I can see that by default, git ignores this directory when uploading my project to github.

当我从github上下载该项目到其他目录,该目录是丢失,该解决方案将无法建立。

When I download the project from github to another directory, this directory is missing and the solution won't build.

什么我需要做的,让这个其他开发人员可以轻松地从github上下载我的code和构建它马上没有任何大惊小怪?

What do I need to do to make it so that another developer can easily download my code from github and build it right away without any fuss?

我还是新来的git,所以很可能我想的东西基本的。

I am still new to git, so it's likely I'm missing something basic.

推荐答案

听起来像是你需要的启用的NuGet包在你的新下载的解决方案恢复。

Sounds like you need to enable NuGet package restore in your newly downloaded solution.

在使用的NuGet与GitHub上,GitHub上忽略在包文件目录,因为它通常不是一个好主意提交的二进制文件(如DLL库)到Git的,因为它导致的Git回购成为臃肿的规模随着时间的推移,因为他们要保持每个版本的回购历史上的一个二进制永远的(除非你回去和 git的过滤分支)。

When using NuGet with GitHub, GitHub ignores the files under the packages directory because it's usually not a good idea to commit binary files (like DLL libraries) to Git, because it causes Git repos to become bloated in size over time because they have to keep each version of a binary in the repo history forever (unless you go back and erase them with git filter-branch).

作为一种变通方法,的NuGet的设计采用了包还原,它规定任何依赖你的解决方案可能会在一个文本xml文件,这是很容易和有效地的Git版本控制。因此,只有该文件应致力于Git的。

As a workaround, NuGet was designed with "package restore", which specifies any dependencies your solution may have in a text xml file, which is easily and efficiently versioned by Git. So only that file should be committed to Git.

当您启用包还原,建立自己的解决方案,将的NuGet检查配置文件,并自动下载在其指定的任何依赖关系。

When you enable package restore and build your solution, NuGet will check the config file and automatically download any dependencies specified in it.

这篇关于在我的项目,该项目采用的NuGet使用github上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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