Urgent.News

What's breaking now, across thousands of outlets.

Tech

The Inverse of `.gitignore`: How Losing a `.env` Turned Into safekeep

The incident It started, as most of these things do, with a .env . I was mid-refactor, needed a key I was sure I'd written down, and the file wasn't there. Not "stale" — gone . Deleted in a cleanup pass I did at 1am, along with a .local.json and a couple of notes I'd been keeping next to the code. The saving grace was a manual backup — a tarball I'd thrown onto an external disk "just in case"…

The story began with a .env file, a crucial piece of information I needed for a mid-refactor project. However, during a cleanup pass at 1am, I realized the file was missing, along with a .local.json and some notes. Thankfully, I had a manual backup on an external disk, but the incident highlighted a larger issue. My source code had three remotes and a CI pipeline, yet my secrets were unprotected.

The solution I devised was to flip the polarity of .gitignore and create a .sync file at the root of a project, listing what should be copied to backup instead of ignored by git. This simple concept allows for a more comprehensive safeguarding of files, such as API keys or production configurations, which should never enter the repository history.

The .sync file uses a similar syntax to .gitignore, with bare patterns, and exclamation marks to negate rules. By default, backup destinations are stored in ~/.safekeep, and projects can have their own .sync files in ~/.safekeep. The system is designed to be lightweight, with no additional dependencies and a simple configuration.

It uses fswatch to monitor filesystem events and copy files when changes occur, ensuring atomic copies and preventing data loss. The primary use cases for .sync include .env files, TLS certificates, editor configurations, runbooks, and .vault directories. To get started, one can install safekeep using pipx or pip, set up fswatch on macOS or Linux, and create a .sync file in the project root to define what should be backed up.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Building a Zero-Ad, Sub-100ms Build Planner for Shape of Dreams on Astro 4

The Problem with Gaming Wikis in 2026 If you play deep roguelites or action RPGs like Shape of Dreams , you know the pain of looking up game mechanics.

  • Tool guarantees sub-100ms performance for accurate, up-to-date game mechanics information
  • Ensures players always have access to current build data without intrusive ads

Google Open-Sourced TorchTPU. PyTorch/XLA Is Deprecated and Gets Archived November 15

Book: LLM Observability Pocket Guide Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go My project: Hermes IDE | GitHub — an IDE for…

  • Google open-sourced TorchTPU on GitHub, replacing deprecated PyTorch/XLA
  • TorchTPU supports TPUs v5e, v5p, v6e, v7 with v8i, v8t roadmap
  • TorchTPU release to be archived November 15, 2026

Critical PHP security update coming

The PHP security team has let it be known that there is a high-stakes security update coming at 14:00 UTC on October 21. " All PHP users are encouraged to prepare now so they can upgrade as soon as…

More from Tuesday 20 October →