Does git perform local to remote compression?

My local repository has about 500 files and a total size of about 125 MB. I initialized the git repository to the repository provided by http://repositoryhosting.com/ . "

I completed the following steps using the git GUI

  • git commit (my local repo)
  • git remote add
  • git click

He said that it booted into Remote Repo and I could see the files, but now the repo only had a size of 26 MB .

I tried to clone git and git in two different cases on another machine from a remote repo. It seems they downloaded exactly 26 MB that was on the remote repo. But when I check the size of the folder on the machine, it shows that it is 125 MB .

Questions:

  • "git push" compress data at boot time in Remote Repo?
  • Am I losing data?
  • If I try to make a copy of a remote repo on several local machines so that several people can work in one project, do I use git Clone or git Pull?
+6
source share
3 answers

"git push" compress data during upload to remote repo?

Yes. It pushes diff delta pack files.

Am I losing data?

No.
After you start working with repo, you:

  • check these packed files in the working tree
  • working with added files stored in .git / objects that are not yet intertwined.
    see " Git Internals - Packfiles " for more.

If I try to make a copy of a remote repo on several local machines so that several people can work in one project, do I use Git Clone or Git Pull?

git clone for an initial copy and checkout of this repo.
Then git pull .

+5
source

In addition to what has already been said, Git's content-addressable storage model naturally deduplicates data, that is, files with the same content are stored only once. I doubt very much that this is happening in your case, but in general and depending on what type of data you store, this is another reason why the Git repository is quite efficient.

+1
source

You do not lose data, since git outputs data using delta coding. By the way, you can clean up unnecessary files and optimize the local repository by doing:

 git gc 

On the gc page:

Performs a number of home tasks in the current repository, such as compressing file changes (to reduce disk space and improve performance) and removing unreachable objects that could have been created from previous git add calls.

0
source

All Articles