Disk full - Wordpress .git objects taking up silly amount of space

Description

/home/virtual/site3/fst/home/username/mainwebsite_html/.git/objects
contains 79GB of objects. The website (wordpress) is only 5.9GB

Steps to Reproduce

du -h /home/virtual/site3/fst/home/username/mainwebsite_html/.git/objects

Expected Behavior

This directory should be maintained (old data removed), no?

Actual Behavior

Disk seems to be filling with these objects.

Environment

ApisCP version
revision: 3ec2e7884c258580fa707cfe827a4269861007c6
timestamp: 1730519492
ver_maj: 3
ver_min: 2
ver_patch: 45
ver_pre: ‘’
dirty: false
debug: false

Operating System:
4.18.0-348.7.1.el8_5.x86_64

Additional relevant information (e.g., PHP version, database, etc.):
Site is running Wordpress 6.7.1

Additional Information

I am in the middle of migrating this server to a new (freshly installed server). I had 6 sites to migrate. 1-4 done, no issues. This is #5. The Rsync portion of the migration was taking forever, pointed me to this being an issue. The migration migrated this 79G of data from the old server to new. I’ve stopped the migration and hope to clean this up before attempting the migration again.

To be clear: not trying to get this server to a “perfect” state, I just want to clean up this directory so that I can migrate the site to my new server.

Any help would be appreciated!

An accumulation of junk data - including logs or separate backups at each snapshot - will contribute to this behavior. To restrict which files are backed up, create a file named .gitignore within the application root for the Web App. Each line is a subdirectory within this path that will be excluded from git during snapshot.

Disabling, then re-enabling snapshots will discard the current git repository on the Web App.

Thanks!

Any chance you can point me towards how to do so from the command line? My web console is toast and this is the last thing I need to do before moving to my new (freshly installed) server instance. I’m digging through the docs now to try to figure it out…

From the WordPress application root (normally same as document root):

rm -rf .git/

Or from command-line, to remove + regenerate:

cpcmd -d DOMAIN wordpress:reconfigure DOMAIN SUBPATH '[git:0]'
cpcmd -d DOMAIN wordpress:reconfigure DOMAIN SUBPATH '[git:1]'

If WordPress is not installed within a subdirectory of a domain, then replace “SUBPATH” with ''.

Note: to regenerate if removed using rm -rf .git/ the “git” feature still needs to be reconfigured by first setting git:0, then git:1 due to an idempotency check.

79G down to 3.7G.

That was the ticket.

Thanks again (very much!!) for the help!