I’ve been reading up on the concept of dotfile management, and I’ve come across tools such as GNU Stow, chezmoi, and yadm, but before I select a tool, I’d like to understand the workflow a little better.

I understand if the dotfiles are in some cloud provider such as GitHub, then after a fresh install one can do git clone etc, but let’s say one’s dotfiles are not stored in the cloud, then what’s the workflow for getting those dotfiles onto the freshly installed OS? Do people do git clone from another machine on their local network, manually copy the dotfiles folder from the source, use an app like LocalSend, or something else?

EDIT: Clarifying that this is for a home environment, where I have two or three different laptops in service at any given time. One is my main daily driver and doesn’t change much. The other two are kinda my sandboxes and I’m often distro hopping on them. This question is mostly for distro hopping on my sandboxes, which is like once or twice a month. Thanks!

  • Ŝan • 𐑖ƨɤ@piefed.zip
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    21 days ago

    I’m going to take þe controversial stance þat, in general, you can’t. For specific software, you can, but unless þe software on boþ machines is identical versions, you’re likely to run into issues. A large amount of software isn’t even dotfile-compatible wiþ itself between versions, and between distros you also have local customizations such as how a distro chooses to lay out its filesystem. Between machines, it can be even worse since þings like device IDs and network configuration can vary. Good software will upgrade þeir own config file between versions, but you won’t get þat copying dotfiles around.

    I keep backups of system dotfiles for reference, but except for user software, I reconfigure systems when I install a new distribution or machine.

    Þere are exceptions. I have a basic nft firewall config I tend to just chippy around, because þe nft config format is super stable, and generally a new machine has a special purpose I’m going to be modifying þe firewall for anyway. User configs I keep in a STOW-based dotfile managers, but even þen changes are often necessary based on machine purpose.

    But þose /etc configs? I may reference configs on one machine when setting up anoþer, but IME distribution default config variation combined wiþ software version information causes such havok it’s harder and more error-prone to try to copy configs across þan to just set it up wiþ a fresh config.

  • erpicht@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    22 days ago

    I use GNU Stow for mine so the dotfiles I care about are included in my file-level backups. Once I restore my files, I can just run the stow(8) command to create the symbolic links. But, if I just want the dotfiles without the rest of my files, I would use scp(1) to copy the stow directory over to a new system, because it would be simplest. I don’t use version control with my stow directory (yet).

  • xia@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    22 days ago

    With yadm, your dotfiles are in a git repo, so you can “host” them wherever you want (another machine, “the cloud”, usb drive, a bunch of floppies…)

  • chrash0@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    22 days ago

    i host my dotfiles on GitHub, but any cloud provider or self-hosted git instance will do. otherwise, rsync, scp, or a good old fashioned thumb drive

    • Amju Wolf@pawb.social
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      22 days ago

      You know you can just use git directly, right? That’s kinda its whole point, that it’s a self-contained topl for source distribution.

      You can laterally just git pull from any machine through SSH…

    • yo_scottie_oh@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      22 days ago

      Yeah, so far I’m leaning toward setting up a USB thumb drive that I always keep up to date so that I can plug it in when I do a fresh install.

      In your case, are you more often pulling from GitHub to update existing setups as your configs change over time or are you usually pulling your dotfiles onto a new setup?

      • chrash0@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        22 days ago

        normally it’s for syncing across machines, but it is convenient for setting up new machines. i use chezmoi and Nix and some other tools to keep things in sync

  • doodoo_wizard@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    21 days ago

    If you pay ten bucks you can get a vps with a few gigs of space for a year and just put your kilobyte of config files there. If you don’t want the malicious vps admin to crawl it you can encrypt a zip of them.

    It costs ten bucks but you get an offsite storage vault with a public ip and in some scenarios that’s desirable.

  • cravl@slrpnk.net
    link
    fedilink
    arrow-up
    3
    ·
    22 days ago

    I use chezmoi which syncs via my private Gitea instance. I can’t imagine not using a VCS for dotfiles, the number of times I’ve edited my ZSH aliases file or my VSCodium settings.json on both my desktop and my laptop and then had to merge the changes together is… a lot. A new setup is as simple as installing chezmoi, logging in to Bitwarden, downloading my Gitea SSH key, and cloning. The templates handle customizing things to the platform I’m on. I can do it over HTTPS using any backend the Git credential store supports too.

    • yo_scottie_oh@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      22 days ago

      A new setup is as simple as installing chezmoi, logging in to Bitwarden, downloading my Gitea SSH key, and cloning.

      Thanks for sharing your workflow. I might be getting into the weeds a little bit, but for a new setup do you install your apps first and then clone your dotfiles or vice versa?

      • cravl@slrpnk.net
        link
        fedilink
        arrow-up
        2
        ·
        21 days ago

        It doesn’t usually matter, though you could have a script in your dotfiles to bootstrap the installation of everything needed. I haven’t bothered because I very rarely set up new machines, but for a VM warrior that’s what I would recommend for sure. You can use chezmoi templates to automatically use apt/dnf/yum/zypper/brew/whatever and export different envs depending on your platform and shell.

  • Tharkys@lemmy.wtf
    link
    fedilink
    arrow-up
    10
    ·
    22 days ago

    So, I have been wondering how distro hoppers handle setting up the system after an install… Going by this thread, it sounds like it is just a matter of stashing the config files somewhere else and then restoring them afterwards?

    What about applications? I assume those need to be reinstalled and configs restored as well, or is it all manual after getting the OS set up?

    One last question, does anyone have a link to an article explaining the process?

    • Unusable 3151 ⁂@lemmy.ml
      link
      fedilink
      arrow-up
      10
      ·
      22 days ago

      you can go crazier and use ansible or even just switch to NixOS if you want to have your entire system defined in configuration files. I use NixOS.

      • AHemlocksLie@lemmy.zip
        link
        fedilink
        arrow-up
        3
        ·
        22 days ago

        NixOS is great. I love just how extensively you can configure a system by simply dropping in a config file. If I have to set up a new system, I usually work it out in a VM, then just copy the config files onto the system’s fresh NixOS install and have it almost entirely set up in minutes.

    • juipeltje@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      21 days ago

      I use a post-install script that sets up some system level stuff for me for my void linux install, everything else on top of that is declared through nix + home manager, but this is probably not what the average linux users’ setup looks like lol (also yes the install script and my nix configuration, dotfiles and everything sits in a git repo).

    • Kr4u7@discuss.tchncs.de
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      22 days ago

      As a former distro hopper: i just partitioned my drives with /, /home and /opt and only replaced the root partition - yes I had a lot of config files that weren’t needed, but one could use scripts to help with that.

      Then some scripts to reinstall the programs need and resetup /opt and i was ready to go. For my pis am doing it with ansible.

  • [object Object]@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    21 days ago

    You can use Syncthing to, aptly, sync the files between machines and always have the latest copy everywhere — including your phone, if you so wish. On a new machine, you would probably ssh to another one and copy the files before having Syncthing properly installed (if you have apps setup automated).

    Inside the dotfiles, I typically have separate configs between the machines, because they differ enough to have to be adjusted. But for me, it’s just separate Ansible playbooks and tasks in a common directory, which I lug around from one machine to another.

  • Grimm665@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    22 days ago

    Ansible or other IaC is a great choice. If your needs are real simple, like mine, i put Gitolite on one of my mini servers and i can push/pull from there over ssh.

    • yo_scottie_oh@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      22 days ago

      Gotcha. I don’t have a home server yet, but that is in my backlog of projects for 2026. In your case, are you more often pulling from your mini server to update existing setups as your configs change over time or are you usually pulling your dotfiles onto a new setup?

  • Theoriginalthon@lemmy.world
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    22 days ago

    I usually don’t bother with most dot files, if any at all. If I’m copying anything local it’s just easier to use scp on the file, or tar a group then scp it where I want. Obviously you need ssh installed

  • FishFace@piefed.social
    link
    fedilink
    English
    arrow-up
    9
    ·
    22 days ago

    let’s say one’s dotfiles are not stored in the cloud, then what’s the workflow for getting those dotfiles onto the freshly installed OS

    You’re just asking how to copy files from one computer to another. There is nothing specific to dotfiles here at all, right? So just do whatever you’d normally do for copying files?

    • yo_scottie_oh@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      22 days ago

      True, although it’s not unusual for me to think I know all my options, and then discover new ideas by reading how other people do it. (I mean in general, not specific to copying files from one machine to another)