Skip to content
πŸ•” Exclude development files from Time Machine backups
Branch: master
Clone or download
Latest commit 7d24214 Jun 17, 2019


Time Machine on macOS is a highly useful tool for creating backups of all your files. Unfortunately for developers, it also backs up your coding project's dependencies, build output and other undesired files, which slows down the backup process and takes up storage.

This is a Python script which excludes files and directories specified in .gitignore files from future Time Machine backups.


Make sure you have Python 3.6 or higher installed.

  1. Clone this repository: git clone REPO_URL
  2. Navigate into the project directory: cd time-machine-ignore
  3. Run the installer script: python This will execute the script for the first time and create an agent which keeps the list of excluded paths up to date (runs once a day).

If your Python installation is not at /usr/local/bin/python3, you'll need to change its path in the in the plist file.


  • If there are certain files ignored by Git which you do want to back up (e.g. configuration or password files), you can create a config.json file in a ~/.config/time-machine-ignore/ folder and add these files to the whitelist:
  "whitelist": [
  • You can change how often you want the script to run in the plist file. Simply change the StartInterval value to the desired interval (in seconds). Run python && python to apply the changes.


Run python in the project directory. This will reset the changes made to Time Machine's list of exclusions, remove the cache and uninstall the launchd agent.

You can’t perform that action at this time.