From d6e7aa05d01f7ff54844871c2f4d7ba12459443c Mon Sep 17 00:00:00 2001 From: Kaboom <58372747+kaboombot@users.noreply.github.com> Date: Tue, 4 Jun 2024 01:01:35 +0300 Subject: [PATCH] reset.sh: remove old commits from git repos Only use the space required by the latest commit. --- script/reset.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/script/reset.sh b/script/reset.sh index d70835c..a71a2c5 100755 --- a/script/reset.sh +++ b/script/reset.sh @@ -10,10 +10,16 @@ pkill -9 java # Sync changes with the GitHub repository cd ~/framework -git pull +git fetch origin --depth 1 +git reset --hard origin/master +git reflog expire --expire=all --all +git gc --prune=all cd ~/server-default -git pull +git fetch origin --depth 1 +git reset --hard origin/master +git reflog expire --expire=all --all +git gc --prune=all chmod -R 777 ~/server/ rm -rf ~/server/*