dotdrop

deadc0de6GPL-3.0活跃维护

用 Python 写的 dotfiles 管理器,把配置文件集中存到 Git 仓库,再通过 Jinja2 模板和 GPG 加密按机器差异部署到各台设备。

Save your dotfiles once, deploy them everywhere

v1.18.1发布于 2026-11-06 08:48 UTC1,957star +1 / 7 天111fork同步于 2026-11-10 11:45 UTC

怎么上手

由 README 提炼,执行前请确认
git submodule add https://github.com/deadc0de6/dotdrop.git
pip3 install -r dotdrop/requirements.txt --user
./dotdrop/bootstrap.sh
硬件要求按 README 说明

README 未说明,纯 Python 工具,无 GPU 或显存要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把 dotfiles 存进 Git,按 profile 在不同主机部署不同版本

用 Python 写的 dotfiles 管理器,把配置文件集中存到 Git 仓库,再通过 Jinja2 模板和 GPG 加密按机器差异部署到各台设备。

核心能力

  • 用 profile 区分主机,同一文件可部署不同版本
  • 支持 dotfile 模板与自定义变量动态生成内容
  • 用 compare 对比已部署文件与仓库中存储的版本
  • 支持导入、更新文件与目录,并可选择符号链接方式
  • 可为特定 dotfile 的部署绑定 action,支持加密/压缩变换

容易踩的坑

以 submodule 方式使用时需先装 requirements.txt 里的 Python 依赖再跑 bootstrap.sh;默认 profile 取当前主机 hostname,跨机部署要显式用 -p/--profile 指定;install 前建议先跑 dotdrop compare 或加 --dry 预览改动

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.18.1
  1. v1.18.1最新正式版2026-11-06 · 2026-11-06 08:48 UTC
  2. v1.18.02026-10-15 · 2026-10-15 14:37 UTC
    查看更新说明

    features:

    bug fixes:

  3. v1.17.02026-09-09 · 2026-09-09 08:03 UTC
    查看更新说明

    features

    • ability to handle directory as a block (#459)

    bug fixes

    • upload sdist to pypi #475 (thanks @branchv)
    • fix #472 when updating deleted nested dir (#474)
    • prune stale link_children symlinks with --remove-existing (#478 thanks @vladkens)
    • fix symlink traversal for #473 (#477)
    • clear workdir to avoid flaky backup test (#482)
    • fix update not honoring template (#481)
    • fix umask (#484)

    doc

    • refactor doc (#470)
  4. v1.16.22026-05-17 · 2026-05-17 21:18 UTC
    查看更新说明

    bug fixes:

    • fix loop detection disallows DAG for #467
    • fix CI/CD, testing
  5. v1.16.12026-04-12 · 2026-04-12 07:30 UTC
    查看更新说明

    bug fixes:

    • ensure actions/transformations honor $SHELL for #465

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    dotdrop

    GitHub release (latest by date) License: GPL v3

    Tests Status Doc Status codecov CodeQL

    Python

    PyPI Homebrew version AUR Snap

    Donate

    Save your dotfiles once, deploy them everywhere

    Dotdrop makes the management of dotfiles between different hosts easy. It allows you to store your dotfiles in Git and automagically deploy different versions of the same file on different setups.

    It also allows to manage different sets of dotfiles. For example, you can have a set of dotfiles for your home laptop and a different set for your office desktop. Those sets may overlap, and different versions of the same dotfiles can be deployed using different predefined profiles. Or you may have a main set of dotfiles for your everyday host and a subset you only need to deploy to temporary hosts (cloud VM etc.) that may be using a slightly different version of some of the dotfiles.

    Features:

    • Sync once every dotfile in Git for different usages
    • Allow dotfile templating
    • Dynamically generated dotfile contents with pre-defined variables
    • Comparison between deployed and stored dotfiles
    • Handling multiple profiles with different sets of dotfiles
    • Easily import and update dotfiles
    • Handle files and directories
    • Support symlinking of dotfiles
    • Associate actions to the deployment of specific dotfiles
    • Associate transformations for storing encrypted/compressed dotfiles
    • Provide solutions for handling dotfiles containing sensitive information

    Check the example, the documentation or how people are using dotdrop for more.

    Quick start:

    ## using dotdrop as a submodule
    mkdir dotfiles && cd dotfiles
    git init
    git submodule add https://github.com/deadc0de6/dotdrop.git
    pip3 install -r dotdrop/requirements.txt --user
    ./dotdrop/bootstrap.sh
    ./dotdrop.sh --help
    

    Why dotdrop?

    There exist many tools to manage dotfiles; however, not many allow to deploy different versions of the same dotfile on different hosts. Moreover, dotdrop allows to specify the set of dotfiles that need to be deployed for a specific profile.

    See the example for a concrete example of why dotdrop rocks.


    Table of Contents

    Installation

    See the installation instructions.

    Dotdrop is available on:

    Getting started

    Create a new repository to store your dotfiles with dotdrop. Init or clone that new repository, install dotdrop and generate a default config file generate config file

    Then import any dotfiles (files or directories) you want to manage with dotdrop. You can either use the default profile (which resolves to the hostname of the host you are running dotdrop on) or provide it explicitly using the switch -p/--profile.

    Import dotfiles on host home:

    $ dotdrop import ~/.vimrc ~/.xinitrc ~/.config/polybar
    

    Dotdrop does two things:

    • Copy the dotfiles to the dotpath directory (defined in config.yaml, defaults to dotfiles)
    • Create the associated entries in the config.yaml file (in the dotfiles and profiles entries)

    Your config file will look like something similar to this:

    config:
      backup: true
      banner: true
      create: true
      dotpath: dotfiles
      ignoreempty: false
      keepdot: false
      longkey: false
      showdiff: false
      workdir: ~/.config/dotdrop
    dotfiles:
      d_polybar:
        dst: ~/.config/polybar
        src: config/polybar
      f_vimrc:
        dst: ~/.vimrc
        src: vimrc
      f_xinitrc:
        dst: ~/.xinitrc
        src: xinitrc
    profiles:
      home:
        dotfiles:
        - f_vimrc
        - f_xinitrc
        - d_polybar
    

    For a description of the different fields and their use, see the config doc.

    Commit and push your changes with git.

    Then go to another host where your dotfiles need to be managed as well, clone the previously set up repository, and compare the local dotfiles with the ones stored in dotdrop:

    $ dotdrop compare --profile=home
    

    Now you might want to adapt the config.yaml file to your liking on that second host. Let's say, for example, that you only want d_polybar and f_xinitrc to be deployed on that second host. You would then change your config to something like this (assuming that the second host's hostname is office):

    …
    profiles:
      home:
        dotfiles:
        - f_vimrc
        - f_xinitrc
        - d_polybar
      office:
        dotfiles:
        - f_xinitrc
        - d_polybar
    

    Then adapt any dotfile using the templating feature (if needed). For example, you might want different fonts sizes in Polybar for each host.

    Edit <dotpath>/config/polybar/config:

    …
    {%@@ if profile == "home" @@%}
    font0 = sans:size=10;0
    {%@@ elif profile == "office" @@%}
    font0 = sans:size=14;0
    {%@@ endif @@%}
    font1 = "Material Design Icons:style=Regular:size=14;0"
    font2 = "unifont:size=6;0"
    …
    

    You also want to have the correct interface set on the wireless network in the Polybar config.

    Add a variable to the config file (In the below example, home gets the default wlan0 value for the variable wifi while office gets wlp2s0):

    …
    variables:
      wifi: "wlan0"
    …
    profiles:
      home:
        dotfiles:
        - f_vimrc
        - f_xinitrc
        - d_polybar
      office:
        dotfiles:
        - f_xinitrc
        - d_polybar
        variables:
          wifi: "wlp2s0"
    

    Then you can adapt the Polybar config file so that the variable wifi gets correctly replaced during installation:

    [module/wireless-network]
    type = internal/network
    interface = {{@@ wifi @@}}
    

    Also, the home computer is running awesomeWM, and the office computer bspwm. The ~/.xinitrc file will therefore be different while still sharing some lines.

    Edit <dotpath>/xinitrc:

    #!/bin/bash
    
    # load Xresources
    userresources=$HOME/.Xresources
    if [ -f "$userresources" ]; then
          xrdb -merge "$userresources" &
    fi
    
    # launch the wm
    {%@@ if profile == "home" @@%}
    exec awesome
    {%@@ elif profile == "office" @@%}
    exec bspwm
    {%@@ endif @@%}
    

    Finally you want everything installed with the office profile to be logged; you thus add an action to the config file:

    …
    actions:
      loginstall: "echo {{@@ _dotfile_abs_src @@}} installed to {{@@ _dotfile_abs_dst @@}} >> {0}"
    …
    profiles:
      home:
        dotfiles:
        - f_vimrc
        - f_xinitrc
        - d_polybar
      office:
        dotfiles:
        - f_xinitrc
        - d_polybar
        variables:
          wifi: "wlp2s0"
        actions:
          - loginstall "/tmp/dotdrop-installation.log"
    

    When done, you can install your dotfiles using:

    $ dotdrop install
    

    If you are unsure, you can always run dotdrop compare to see how your local dotfiles would be updated by dotdrop before running install or you could run install with --dry.

    That's it, a single repository with all your dotfiles for your different hosts.

    For more, see the docs:

    Documentation

    Dotdrop's documentation is hosted on Read the Docs.

    Thank you

    If you like dotdrop, buy me a coffee.

    Contribution

    If you are having trouble installing or using dotdrop, open an issue.

    If you want to contribute, feel free to do a PR (please follow PEP8). Have a look at the contribution guidelines.

    License

    This project is licensed under the terms of the GPLv3 license.