Home > Blockchain >  Git - checking out more files than in repository
Git - checking out more files than in repository

Time:04-12

We're migrating our repos from TFS to Git and for one of our repos, the clone process and checking out on the build machine says it's receiving objects and shows a count of 30,000. Our repo only has around 2000 files in it. How can we find out what it's actually checking out? More importantly, how do we fix it?

TIA

CodePudding user response:

In git, every "working copy" is actually a full "clone" of the repository. That includes the full history of every file, and the metadata of every commit, branch, tag, etc.

This allows you to work with the history without an active connection to the central server - indeed, git was originally designed not to have a central server at all, although in practice a service such as Github or GitLab is frequently used as a central "source of truth" for collaboration.

The objects being "received" are not the files being checked out to work on right now, they are the constituents of that history database. This is perfectly normal, and not something you need to fix.

Once the clone has completed, you will see the working copy contains the ~2000 files you expect, plus a directory called ".git", which is where everything else is stored. There won't be 30000 files in there either, because git packs multiple "objects" in the database into optimised and compressed files.

  •  Tags:  
  • git
  • Related