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)

  • How to create and commit a branch in gitlab
  • Git convention to indicate throw away branches
  • Unable to show a Git tree in terminal
  • SourceTree - git: fatal: remote error: Repository not found
  • How do I manage an open-source and commercial version of the same project using source control?
  • How do I do a 'git status' so it doesn't display untracked files without using .gitignore?
  • 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…

  • Github push error: unpack failed: index-pack abnormal exit
  • Git how to revert a commit but remember the work?
  • git log --tags changes the commits order
  • Git setup for non-developers
  • Git fetch/pull have stopped working
  • Suggestions for Distributed Version Control in Eclipse
  • 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.