This repo contains the dotfiles I share between different Linux & Windows environments.
I use yadm, “yet another dotfiles manager”, to manage my dotfiles so first you need to install yadm. The yadm documentation describes several ways to install it but if you’re in a rush, clone the repo:
git clone https://github.com/TheLocehiliosan/yadm.git
You can find the yadm
script in the root of the workspace.
To install the dotfiles in this repo, execute
yadm/yadm clone https://github.com/swinkels/yadm-dotfiles.git
Note the following comment from the yadm documentation:
If a file already exists locally and has content that differs from the one in the repository, the local file will be left unmodified and you’ll have to review and resolve the differences.
In effect, yadm uses a bare Git repo in $HOME/.local/share/yadm/repo.git
with
your home directory as a work tree[fn:1]. This repo doesn’t show untracked
files, so a yadm status
only checks files that are managed by Git.
yadm uses a different approach to support the alternate files, which are
variants of the same file. It depends on your “environment” which variant yadm
will install, for example on the OS used or on the name of the machine name. You
create every variant in a special directory, namely $HOME/.config/yadm/alt
.
Then, when you execute yadm clone
or yadm pull
, yadm creates a link to the
correct variant in the root of your home directory.
The Windows filesystem NTFS does support links but that functionality isn’t enabled by default. According to this article, you have to
- run Windows in Developer Mode,
- edit the local security policy to grant permissions to create symlinks, and
- (possibly) configure the software you use, e.g. MSYS2 and cygwin.
You might not be possible to execute steps 1) and 2), for example on a company laptop where you don’t have sufficient rights to make these kindes of changes.
On Windows, I always use yadm in a Bash shell that is provided by MSYS2. If I
cannot enable the functionality to create links, MSYS2 creates a well-named copy
of the file instead. This means that if I want to modify an alternate file, I
have to edit the original file in $HOME/.config/yadm/alt
and reinstall all
alternate files.
[fn:1] Starting with version 3, yadm uses $HOME/.local/share/yadm/repo.git
to
store the bare repo. Version 2 used $HOME/.config/yadm
and version 1 used
$HOME/.yadm
.