Search code examples
gitmacosstoragegithub-for-mac

Purge hidden storage on Github Desktop OSX?


I have several folders of jpg files on my OSX laptop, cloned from a GitHub repository. The files I can see total less than 20GB, but my system tells me that they occupy 65+GB.

https://i.sstatic.net/65BFp.png

Where are these hidden files? How can I purge them?

I should mention that there is only one branch in the repository.

(Also, I know that GitHub is not meant to be a place to store lots of image files. This repo is a component of a larger project.)


Solution

  • As mentioned in "Show system files / Show git ignore in osx", use in your Finder .

    That should show you the hidden folder .git/, which include all the history of the repo.
    And for a repo of binaries (like jpeg images), and new version of an image might take quite a lot of place (poor diff, poor compression between each version)

    I wonder if there's any way I can purge this history from local storage? (I'd like to keep it in the cloud)

    You would need to download only the archive of the repo (meaning the content, without the history).
    If you don't need to change and push back those modification, the archive would be enough.

    If you need the history, a shallow clone (git clone --depth 1) that I detailed here (or here) is best to keep the downloaded data at a minimum.