Nuget : how to NOT remove old packages after package update?

A couple months ago we’ve started using Nuget in our ASP.NET MVC projects. We’re building a lot of applications that consist of several reusable compontents. For example:

Application A
– Authentication Module (nuget package with JavaScript/Templates/Controllers/POCO)
– Payment Module (nuget package with JavaScript/Templates/Controllers/POCO)

  • When I clone a Git repository do I get the whole thing?
  • gitkraken doesn't automatically delete remote feature branches
  • Updating multiple branches of a forked repository on Github
  • Github shows wrong time of commits
  • I moved all my project files with “git mv”, but I have lost all my history. Why?
  • How to I update the path to a moved git-svn remote branch
  • Application B
    – Authentication Module (nuget package with JavaScript/Templates/Controllers/POCO)

    But our team has grown a lot the last weeks and we’re experiencing some problems when merging packages. Everytime we update a package, the old version package is removed from the package folder. This is great, but it causes a lot of problems when merging/checkin into git (we use tortoiseGit). For Example:

    Developer 1 updates the Authentication module in Application A to version 2.0 and checks this in. Developer 2 is also working on Application A and updates the Authentication module to version 2.1. Developer 1 checks in before Developer 2. When Developer 2 pulls the latest changes from git and tries to checkin his changes he will experience a lot of conflicts in the nuget packages folder because he doesnt have the files from version 2.0 in his package folder (TortoiseGit Error: FileNotFound). Now Developer 1 has to create the package folder in his local file system and mark it as deleted to be able to checkin in his changes.

    This problem would be resolved if Nuget doesn’t delete old package folders on an update. Is this possible? In this scenario we would of course clean up old packages in the nuget package folder manually…

  • Git adding “unchanged” files to the stage
  • How to remove a submodule from the current branch
  • How do I query if a commit lies between two known commits?
  • github server verification failed
  • Download Android v10 source through git
  • Pull says there are changes, stash says there are no changes?
  • One Solution collect form web for “Nuget : how to NOT remove old packages after package update?”

    It sounds like a better solution for your team would be to not include the packages folder in version control, and instead enable package restore.

    If you use Nuget 2.7+ , visit this site

    Git Baby is a git and github fan, let's start git clone.