-1

The git repository directory on the test server is 1.1GB big. How can I reduce the directory?

Approach. Scripts are developed on my computer. Uploaded to the Git repository by Jenkins to test the server to test. The Git directory on the test server has grown to 1.1GB, which is the directory .git / objects. How can I reduce it?

Can I simply delete the subdirectories of .git / objects? Or is this handled by a git commands?

On the picture, schematic representation of the workings enter image description here

greetings

webuser57
  • 171
  • 2
  • 9

2 Answers2

0

This may help when doing git clone try shallow clone with some limited depth


git fetch --tags --progress https://github.com/org/project.git +refs/heads/*:refs/remotes/origin/* --depth=50 # timeout=10


that should reduce the size of the project

learningJava
  • 188
  • 6
0

My approach and my solution.
Log on the "test server".
Change to the directory /var/www/.
First of all, I did the following

       dh -hs .git

output 1.1GB then

        git count-objects -v

last command

        git repack -a -d --depth=500 --window=250

I followed the link from CodeCaster: how to shrink the .git folder

webuser57
  • 171
  • 2
  • 9