Skip to content

Commit

Permalink
adds git_maintenance helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
lkwg82 committed May 26, 2024
1 parent 5becab7 commit 95298a6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,18 @@ function git_reset_with_submodules_recursivly(){

git reset --hard --recurse-submodule
}

function git_maintenance() {
if [[ ! -d .git ]]; then
echo "need to be in git repository"
exit 1
fi

du -sh

git maintenance run --task=gc
git maintenance run --task=pack-refs
git maintenance run --task=loose-objects

du -sh
}

0 comments on commit 95298a6

Please sign in to comment.