Is there a way to reduce the size of the git folder?

后端 未结 7 1749
眼角桃花
眼角桃花 2020-12-12 09:44

Seems like my project is getting bigger and bigger with every git commit/push. Is there a way to clean up my git folder?

7条回答
  •  温柔的废话
    2020-12-12 10:08

    Run:

    git remote prune origin
    

    Deletes all stale tracking branches which have already been removed at origin but are still locally available in remotes/origin.

    git gc --auto
    

    'G arbage C ollection' - runs housekeeping tasks (compresses revisions, removes loose/inaccessible objects). The --auto flag first determines whether any work is required, and exits without doing anything if not.

提交回复
热议问题