Dealing with Small MacBook Pro Disks with Git deinit and Photo Library

OK, one maddening thing that happened is one of my MacBooks has a tiny, as in 256GB hard drive. This is just too small for most uses particularly if you have lots of iCloud Photos or big github repos. I have both, so what are some solutions?

Slim down the random files

Well, if you use Space Gremlin as an example, you get a nice graphical view of your dirve and at least for me, I discovered that my ~/Library had over 50GB in it. That is a huge amount of space on it and here were some culprits. And all told, this got rid of 70GB by removing some caches and some big applications:

  1. Mactex. This is the Tex program for compositing documents and it takes 4GB of disk plus Texlive takes another 7GB, so unless you really need to write research papers this is a good ting to go.
  2. Homebrew keeps nearly all it’s old downloads in ~/Caches/Homebrew/downloads and that is 9GB on this machine. which you can get rid of with brew cleanup -s and this got rid of 3GB
  3. Google Chrome is 3GB and has a big cache. I also use Vivaldi and it duplicates the functions. Another one is Wireshark which I also rarefly use. The System Information application is really useful for seeing what is taking up space.
  4. XCode also has separate caches for every version of MacOS, iOS and iPadOS it has ever run, so if you’ve been using it alot go to ~/Library/Developer and each simulator takes up alot of space, so crank up XCode and remove those by starting XCode and going to Window/Simulators and removing all the old ones. The truth is thought that you really do not need all of Xcode, most of the time the commandline tools is all you need. So it is hard to eradicate Xcode as it is just everywhere but you can start by trashing /Applications/Xcode.app, ~/Library/Developer, ~/Library /Cache
  5. Docker has 8GB worth of containers, so you can run docker prune -a to get rid of all iamges and containers.
  6. Git submodules. Ok, if you are using Git LFS, you can end up with some very large submodules and remember Git copies all versions down, so we have one system that is doing lots of images and it takes over 15GB, so the command to use is git submodule deinit <name of module> this does not remove it from the repo, just the copy on the local machine. Similarly there is a cached copy of all submodules you’ve ever had on your machine, so you need to go to .git/modules and look for the submodule and remove that. This is just a cache, so it is for performance, but in my case, it duplicated the whole thing so useful to get rid of.
  7. Raspberry Pi Imager. This is another strange case, but this imager caches all the images you have, so get rid of this in ~/Library/Cache/Rasperry Pi
  8. CAches of previously deleted applications, so when you delete an application in /Applications, this does not get rid of the corresponding cache in ~/Library/Cache, so deleting Google, Unifi, Microsoft saves quite a bit of space
  9. The same is true of the ~/Library/Applications Support directory where I found lots of old applications like Google again and Unifi.

Get a thunderbolt Hard Drive

Well, this is not something that is very portable, but if you have something like this then you can move some files like the Photo library there. At least for me, the Photo Library because it has a cached copy of all 50K of my photos ends up being 1TB. Now, this means you cannot use this stuff while traveling, but I normally only need this when I’m scanning photos, etc.

Get a USB C Flash Drive

If you really need stuff on the road like photos, you can now get a tiny USB C Drive that you can stick into the port for real storage while traveling. a 256GB drive while much slower than the boot SSD is very handy if you really do run out of space.

I’m Rich & Co.

Welcome to Tongfamily, our cozy corner of the internet dedicated to all things technology and interesting. Here, we invite you to join us on a journey of tips, tricks, and traps. Let’s get geeky!

Let’s connect