dotfiles-drift
Detect drift between your dotfiles repo and $HOME.
Answer the question: "What changed on my machine that's not in my dotfiles repo, and vice versa?"
Quick Start (5 min)
pip install dotfiles-drift
# Check drift in your dotfiles repo
dotfiles-drift status ~/dotfiles
Typical output shows synced, missing, modified, and orphaned files across your repo and $HOME.
Use dotfiles-drift status ~/dotfiles --format json for script-friendly output.
## Why
You keep your dotfiles in a git repo. You clone it onto a new machine. But which files did you forget to add? Which files exist in `$HOME` but not in the repo? Which files have been modified locally without being committed?
`dotfiles-drift` tells you:
| Status | Meaning |
|--------|---------|
| **synced** | Repo and home have identical content |
| **missing** | File exists in repo but not in home (need to symlink/copy) |
| **modified** | File exists in both but content differs |
| **orphaned** | File exists in home but not in repo |
## Install
```bash
pip install dotfiles-drift
Usage
# Check drift status
dotfiles-drift status ~/dotfiles
# Export as JSON
dotfiles-drift status ~/dotfiles --format json
# Sync missing/modified files from repo to home (dry run)
dotfiles-drift sync ~/dotfiles --dry-run
# Actually sync
dotfiles-drift sync ~/dotfiles --force
# Only check git-tracked files
dotfiles-drift status ~/dotfiles --only-tracked
Example Output
Dotfiles Drift — /root/dotfiles
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ File ┃ Status ┃ Details ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ .bashrc │ synced │ │
│ .gitconfig │ modified │ repo=2026-09-12 home=2026-08-30 │
│ .vimrc │ missing │ exists in repo, not in $HOME │
│ .zshrc │ orphaned │ exists in $HOME, not in repo │
└──────────────┴──────────────┴────────────────────────────────────┘
Summary: 1 synced | 1 missing | 1 modified | 1 orphaned
Features
- SHA256 content comparison (not just size/mtime)
- Detects orphaned files (exist in
$HOMEbut not in repo) - Git-tracked-only mode
- JSON output for scripting
- Dry-run sync mode
- Ignores
.git,README.md,LICENSE,Makefile,*.bak,*.swpby default
Security model
dotfiles-drift reads and hashes every file it scans, so it treats the repository you point it at as untrusted input:
- Each file is resolved with
Path.resolve()before it is read. A file in the repo must resolve inside the repo; a file in$HOMEmust resolve inside$HOMEor the repo (so symlinks created by tools such as GNU Stow keep working). - Files that resolve anywhere else, for example a
.bashrc -> /etc/shadowsymlink in a malicious repo, are skipped and a warning is written to stderr. --allow-unsafe-symlinks(onstatusandsync) turns the check off. Only use it on repositories you trust.synconly previews changes unless you pass--force. Review the preview before applying changes from a repo you did not write.--dry-runis authoritative: a preview never writes, even when combined with--force. Without either flag,syncpreviews too.
Alternatives
- GNU Stow — symlink manager, not drift detector
- yadm — dotfiles manager with git, but no drift reporting
- chezmoi — has
chezmoi diffbut heavier tool - rcm — rc file management, no content diff
dotfiles-drift is a read-only detector — it reports what's out of sync. You decide whether to symlink, copy, or use a full dotfiles manager.
Sponsoring
dotfiles-drift is MIT licensed and free to use. If it earns a permanent place in your setup, you can support continued maintenance via GitHub Sponsors or by sending SOL to the project treasury wallet:
Eeztv1nCYUt1fwGWpzKC948gaWfjejYCAuLtUMgzDWbW
Funding platforms are configured in .github/FUNDING.yml.
If this tool is useful to you, a star helps other people find it.
Related tools
- driftcheck — detect version drift between docs and toolchain files
- license-drift — detect license drift across a monorepo
- cli-shim — shim CLI flags across tools with different syntax
- sandbox-ffi-layers — layer FFI calls behind a sandbox boundary
Part of a family of focused, single-purpose developer tools — each one does one thing and does it well.
License
MIT
Metadata
Release files for dotfiles-drift 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dotfiles_drift-0.2.3.tar.gz | 18.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dotfiles_drift-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.0 kB
Release files / dotfiles_drift-0.2.3.tar.gz
| Download URL | dotfiles_drift-0.2.3.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e305d6a84bd2f2c9460d3dd800577f66c0d73907c2295430a0e55367111db1b8
|
|
BLAKE2b-256 checksum How to use checksums |
f908b7020369f8aed640d10a9544dd1795ef7e76070b9616f71b02462ea883e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / dotfiles_drift-0.2.3-py3-none-any.whl
| Download URL | dotfiles_drift-0.2.3-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31402200f82ed5ba86dbe70acb4419a4f3349b81287464121a84b39c6897a470
|
|
BLAKE2b-256 checksum How to use checksums |
1aa58180fd76c88ee925883432309d175f2542fd47f0eabd4b97b3a3ec60ae7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for dotfiles-drift 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for dotfiles_drift-0.2.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.