@ -75,10 +75,11 @@
clone url
clone url
Clone a remote repository for tracking dotfiles. After the con-
Clone a remote repository for tracking dotfiles. After the con-
tents of the remote repository have been fetched, a "merge" of
tents of the remote repository have been fetched, a "merge" of
origin/master is attempted. If there are conflicting files
the remote HEAD branch is attempted. If there are conflicting
already present in the work-tree, this merge will fail and
files already present in the work-tree, this merge will fail and
instead a "reset" of origin/master will be done, followed by a
instead a "reset" of the remote HEAD branch will be done, fol-
"stash". This "stash" operation will preserve the original data.
lowed by a "stash". This "stash" operation will preserve the
original data.
You can review the stashed conflicts by running the command
You can review the stashed conflicts by running the command
@ -91,26 +92,26 @@
or
or
yadm stash pop
yadm stash pop
The repository is stored in $HOME/.config/yadm/repo.git. By
The repository is stored in $HOME/.local/share/yadm/repo.git.
default, $HOME will be used as the work-tree, but this can be
By default, $HOME will be used as the work-tree, but this can be
overridden with the -w option. yadm can be forced to overwrite
overridden with the -w option. yadm can be forced to overwrite
an existing repository by providing the -f option. If you want
an existing repository by providing the -f option. If you want
to use a branch other than origin/master, you can specify it
to use a branch other than the remote HEAD branch you can spec-
using the -b option. By default yadm will ask the user if the
ify it using the -b option. By default yadm will ask the user
bootstrap program should be run (if it exists). The options
if the bootstrap program should be run (if it exists). The
--bootstrap or --no-bootstrap will either force the bootstrap to
options --bootstrap or --no-bootstrap will either force the
be run, or prevent it from being run, without prompting the
bootstrap to b e run, or prevent it from being run, without
user.
prompting the user.
config This command manages configurations for yadm. This command
config This command manages configurations for yadm. This command
works exactly the way git-config(1) does. See the CONFIGURATION
works exactly the way git-config(1) does. See the CONFIGURATION
section for more details.
section for more details.
decrypt
decrypt
Decrypt all files stored in $HOME/.config/yadm/files.gpg. Files
Decrypt all files stored in $HOME/.local/share/yadm/archive.
decrypted will be relative to the configured work-tree (usually
Files decrypted will be relative to the configured work-tree
$HOME). Using the -l option will list the files stored without
(usually $HOME). Using the -l option will list the files stored
extracting them.
without extracting them.
encrypt
encrypt
Encrypt all files matching the patterns found in $HOME/.con-
Encrypt all files matching the patterns found in $HOME/.con-
@ -138,9 +139,7 @@
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))))
(tramp-remote-shell-args ("-c"))))
With this config, use (magit-status "/yadm::"). If you find
With this config, use (magit-status "/yadm::").
issue with Emacs 27 and zsh, trying running (setenv "SHELL"
"/bin/bash").
git-crypt options
git-crypt options
If git-crypt is installed, this command allows you to pass
If git-crypt is installed, this command allows you to pass
@ -167,7 +166,7 @@
help Print a summary of yadm commands.
help Print a summary of yadm commands.
init Initialize a new, empty repository for tracking dotfiles. The
init Initialize a new, empty repository for tracking dotfiles. The
repository is stored in $HOME/.config/yadm/repo.git. By
repository is stored in $HOME/.local/share/yadm/repo.git. By
default, $HOME will be used as the work-tree, but this can be
default, $HOME will be used as the work-tree, but this can be
overridden with the -w option. yadm can be forced to overwrite
overridden with the -w option. yadm can be forced to overwrite
an existing repository by providing the -f option.
an existing repository by providing the -f option.
@ -197,63 +196,46 @@
https://github.com/elasticdog/transcrypt for details.
https://github.com/elasticdog/transcrypt for details.
upgrade
upgrade
Version 2 of yadm uses a different directory for storing your
Version 3 of yadm uses a different directory for storing data.
configurations. When you start to use version 2 for the first
When you start to use version 3 for the first time, you may see
time, you may see warnings about moving your data to this new
warnings about moving your data to this new directory. The eas-
directory. The easiest way to accomplish this is by running
iest way to accomplish this is by running "yadm upgrade". This
"yadm upgrade". This command will start by moving your yadm
command will start by moving your yadm repo to the new path.
repo to the new path. Next it will move any configuration data
Next it will move any archive data. If the archive is tracked
to the new path. If the configurations are tracked within your
within your yadm repo, this command will "stage" the renaming of
yadm repo, this command will "stage" the renaming of those files
that file in the repo's index. Upgrading will also re-initial-
in the repo's index. Upgrading will also re-initialize all sub-
ize all submodules you have added (otherwise they will be broken
modules you have added (otherwise they will be broken when the
when the repo moves). After running "yadm upgrade", you should
repo moves). After running "yadm upgrade", you should run "yadm
run "yadm status" to review changes which have been staged, and
status" to review changes which have been staged, and commit
commit them to your repository.
them to your repository.
You can read https://yadm.io/docs/upgrade_from_2 for more infor-
You can read https://yadm.io/docs/upgrade_from_1 for more infor-
mation.
mation.
version
version
Print the version of yadm.
Print the version of yadm.
## COMPATIBILITY
Beginning with version 2.0.0, yadm introduced a couple major changes
which may require you to adjust your configurations. See the upgrade
command for help making those adjustments.
First, yadm now uses the "XDG Base Directory Specification" to find its
configurations. You can read https://yadm.io/docs/upgrade_from_1 for
more information.
Second, the naming conventions for alternate files have been changed.
You can read https://yadm.io/docs/alternates for more information.
If you want to retain the old functionality, you can set an environment
variable, YADM_COMPATIBILITY=1. Doing so will automatically use the
old yadm directory, and process alternates the same as the pre-2.0.0
version. This compatibility mode is deprecated, and will be removed in
future versions. This mode exists solely for transitioning to the new
paths and naming of alternates.
## OPTIONS
## OPTIONS
yadm supports a set of universal options that alter the paths it uses.
yadm supports a set of universal options that alter the paths it uses.
The default paths are documented in the FILES section. Any path speci-
The default paths are documented in the FILES section. Any path speci-
fied by these options must be fully qualified. If you always want to
fied by these options must be fully qualified. If you always want to
override one or more of these paths, it may be useful to create an
override one or more of these paths, it may be useful to create an
alias for the yadm command. For example, the following alias could be
alias for the yadm command. For example, the following alias could be
used to override the repository directory.
used to override the repository directory.
alias yadm='yadm --yadm-repo /alternate/path/to/repo'
alias yadm='yadm --yadm-repo /alternate/path/to/repo'
The following is the full list of universal options. Each option
The following is the full list of universal options. Each option
should be followed by a fully qualified path.
should be followed by a fully qualified path.
-Y,--yadm-dir
-Y,--yadm-dir
Override the yadm directory. yadm stores its data relative to
Override the yadm directory. yadm stores its configurations
this directory.
relative to this directory.
--yadm-data
Override the yadm data directory. yadm stores its data relative
to this directory.
--yadm-repo
--yadm-repo
Override the location of the yadm repository.
Override the location of the yadm repository.
@ -287,10 +269,6 @@
bolic links. This might be desirable, because some systems may
bolic links. This might be desirable, because some systems may
not properly support symlinks.
not properly support symlinks.
NOTE: The deprecated yadm.cygwin-copy option used by older ver-
sions of yadm has been replaced by yadm.alt-copy. The old
option will be removed in the next version of yadm.
yadm.auto-alt
yadm.auto-alt
Disable the automatic linking described in the section ALTER-
Disable the automatic linking described in the section ALTER-
NATES. If disabled, you may still run "yadm alt" manually to
NATES. If disabled, you may still run "yadm alt" manually to
@ -310,42 +288,63 @@
Disable the automatic creating of private directories described
Disable the automatic creating of private directories described
in the section PERMISSIONS.
in the section PERMISSIONS.
yadm.cipher
Configure which encryption system is used by the encrypt/decrypt
commands. Valid options are "gpg" and "openssl". The default is
"gpg". Detailed information can be found in the section ENCRYP-
TION.
yadm.git-program
yadm.git-program
Specify an alternate program to use instead of "git". By
Specify an alternate program to use instead of "git". By
default, the first "git" found in $PATH is used.
default, the first "git" found in $PATH is used.
yadm.gpg-perms
yadm.gpg-perms
Disable the permission changes to $HOME/.gnupg/*. This feature
Disable the permission changes to $HOME/.gnupg/*. This feature
is enabled by default.
is enabled by default.
yadm.gpg-program
yadm.gpg-program
Specify an alternate program to use instead of "gpg". By
Specify an alternate program to use instead of "gpg". By
default, the first "gpg" found in $PATH is used.
default, the first "gpg" found in $PATH is used.
yadm.gpg-recipient
yadm.gpg-recipient
Asymmetrically encrypt files with a gpg public/private key pair.
Asymmetrically encrypt files with a gpg public/private key pair.
Provide a "key ID" to specify which public key to encrypt with.
Provide a "key ID" to specify which public key to encrypt with.
The key must exist in your public keyrings. Multiple recipients
The key must exist in your public keyrings. Multiple recipients
can be specified (separated by space). If left blank or not
can be specified (separated by space). If left blank or not
provided, symmetric encryption is used instead. If set to
provided, symmetric encryption is used instead. If set to
"ASK", gpg will interactively ask for recipients. See the
"ASK", gpg will interactively ask for recipients. See the
ENCRYPTION section for more details. This feature is disabled
ENCRYPTION section for more details. This feature is disabled
by default.
by default.
yadm.openssl-ciphername
Specify which cipher should be used by openssl. "aes-256-cbc"
is used by default.
yadm.openssl-old
Newer versions of openssl support the pbkdf2 key derivation
function. This is used by default. If this configuration is set
to "true", openssl operations will use options compatible with
older versions of openssl. If you change this option, you will
need to recreate your encrypted archive.
yadm.openssl-program
Specify an alternate program to use instead of "openssl". By
default, the first "openssl" found in $PATH is used.
yadm.ssh-perms
yadm.ssh-perms
Disable the permission changes to $HOME/.ssh/*. This feature is
Disable the permission changes to $HOME/.ssh/*. This feature is
enabled by default.
enabled by default.
The following four "local" configurations are not stored in the
The following four "local" configurations are not stored in the
$HOME/.config/yadm/config, they are stored in the local repository.
$HOME/.config/yadm/config, they are stored in the local repository.
local.class
local.class
Specify a class for the purpose of symlinking alternate files.
Specify a class for the purpose of symlinking alternate files.
By default, no class will be matched.
By default, no class will be matched.
local.hostname
local.hostname
Override the hostname for the purpose of symlinking alternate
Override the hostname for the purpose of symlinking alternate
files.
files.
local.os
local.os
@ -360,9 +359,9 @@
to have an automated way of choosing an alternate version of a file for
to have an automated way of choosing an alternate version of a file for
a different operating system, host, user, etc.
a different operating system, host, user, etc.
yadm will automatically create a symbolic link to the appropriate ver-
yadm will automatically create a symbolic link to the appropriate ver-
sion of a file, when a valid suffix is appended to the filename. The
sion of a file, when a valid suffix is appended to the filename. The
suffix contains the conditions that must be met for that file to be
suffix contains the conditions that must be met for that file to be
used.
used.
The suffix begins with "##", followed by any number of conditions sepa-
The suffix begins with "##", followed by any number of conditions sepa-
@ -370,9 +369,9 @@
##< condition > [,< condition > ,...]
##< condition > [,< condition > ,...]
Each condition is an attribute/value pair, separated by a period. Some
Each condition is an attribute/value pair, separated by a period. Some
conditions do not require a "value", and in that case, the period and
conditions do not require a "value", and in that case, the period and
value can be omitted. Most attributes can be abbreviated as a single
value can be omitted. Most attributes can be abbreviated as a single
letter.
letter.
< attribute > [.< value > ]
< attribute > [.< value > ]
@ -382,25 +381,25 @@
template, t
template, t
Valid when the value matches a supported template processor.
Valid when the value matches a supported template processor.
See the TEMPLATES section for more details.
See the TEMPLATES section for more details.
user, u
user, u
Valid if the value matches the current user. Current user is
Valid if the value matches the current user. Current user is
calculated by running id -u -n.
calculated by running id -u -n.
distro, d
distro, d
Valid if the value matches the distro. Distro is calculated by
Valid if the value matches the distro. Distro is calculated by
running lsb_release -si or by inspecting the ID from /etc/os-
running lsb_release -si or by inspecting the ID from /etc/os-
release.
release.
os, o Valid if the value matches the OS. OS is calculated by running
os, o Valid if the value matches the OS. OS is calculated by running
uname -s.
uname -s.
class, c
class, c
Valid if the value matches the local.class configuration. Class
Valid if the value matches the local.class configuration. Class
must be manually set using yadm config local.class < class > . See
must be manually set using yadm config local.class < class > . See
the CONFIGURATION section for more details about setting
the CONFIGURATION section for more details about setting
local.class.
local.class.
hostname, h
hostname, h
@ -410,6 +409,12 @@
default
default
Valid when no other alternate is valid.
Valid when no other alternate is valid.
extension, e
A special "condition" that doesn't affect the selection process.
Its purpose is instead to allow the alternate file to end with a
certain extension to e.g. make editors highlight the content
properly.
NOTE: The OS for "Windows Subsystem for Linux" is reported as "WSL",
NOTE: The OS for "Windows Subsystem for Linux" is reported as "WSL",
even though uname identifies as "Linux".
even though uname identifies as "Linux".
@ -550,10 +555,11 @@
whatever##template with the following content
whatever##template with the following content
{% if yadm.user == 'harvey' %}
{% if yadm.user == "harvey" %}
config={{yadm.class}}-{{yadm.os}}
config={{yadm.class}}-{{yadm.os}}
{% else %}
{% else %}
config=dev-whatever
config=dev-whatever
{% include "whatever.extra" %}
{% endif %}
{% endif %}
would output a file named whatever with the following content if the
would output a file named whatever with the following content if the
@ -561,9 +567,10 @@
config=work-Linux
config=work-Linux
and the following otherwise:
and the following otherwise (if whatever.extra contains admin=false) :
config=dev-whatever
config=dev-whatever
admin=false
An equivalent Jinja template named whatever##template.j2 would look
An equivalent Jinja template named whatever##template.j2 would look
like:
like:
@ -572,6 +579,7 @@
config={{YADM_CLASS}}-{{YADM_OS}}
config={{YADM_CLASS}}-{{YADM_OS}}
{% else -%}
{% else -%}
config=dev-whatever
config=dev-whatever
{% include 'whatever.extra' %}
{% endif -%}
{% endif -%}
An equivalent ESH templated named whatever##template.esh would look
An equivalent ESH templated named whatever##template.esh would look
@ -581,6 +589,7 @@
config=< %= $YADM_CLASS %>-< %= $YADM_OS %>
config=< %= $YADM_CLASS %>-< %= $YADM_OS %>
< % else -%>
< % else -%>
config=dev-whatever
config=dev-whatever
< %+ whatever.extra %>
< % fi -%>
< % fi -%>
@ -590,7 +599,9 @@
into a Git repository, which often resides on a public system. yadm can
into a Git repository, which often resides on a public system. yadm can
make it easy to encrypt and decrypt a set of files so the encrypted
make it easy to encrypt and decrypt a set of files so the encrypted
version can be maintained in the Git repository. This feature will
version can be maintained in the Git repository. This feature will
only work if the gpg(1) command is available.
only work if a supported tool is available. Both gpg(1) and openssl(1)
are supported. gpg is used by default, but openssl can be configured
with the yadm.cypher configuration.
To use this feature, a list of patterns must be created and saved as
To use this feature, a list of patterns must be created and saved as
$HOME/.config/yadm/encrypt. This list of patterns should be relative
$HOME/.config/yadm/encrypt. This list of patterns should be relative
@ -608,9 +619,9 @@
The yadm encrypt command will find all files matching the patterns, and
The yadm encrypt command will find all files matching the patterns, and
prompt for a password. Once a password has confirmed, the matching
prompt for a password. Once a password has confirmed, the matching
files will be encrypted and saved as $HOME/.config/yadm/files.gpg. The
files will be encrypted and saved as $HOME/.local/share/yadm/archive.
patterns and files.gpg should be added to the yadm repository so they
The "encrypt" and "archive" files should be added to the yadm reposi-
are available across multiple systems.
tory so they are available across multiple systems.
To decrypt these files later, or on another system run yadm decrypt and
To decrypt these files later, or on another system run yadm decrypt and
provide the correct password. After files are decrypted, permissions
provide the correct password. After files are decrypted, permissions
@ -627,13 +638,17 @@
This is to prevent accidentally committing sensitive data to the repos-
This is to prevent accidentally committing sensitive data to the repos-
itory. This can be disabled using the yadm.auto-exclude configuration.
itory. This can be disabled using the yadm.auto-exclude configuration.
Using git-crypt
Using transcrypt or git-crypt
A completely separate option for encrypting data is to install and use
A completely separate option for encrypting data is to install and use
git-crypt. Once installed, you can run git-crypt commands for the yadm
transcrypt or git-crypt. Once installed, you can use these tools by
repo by running yadm git-crypt. git-crypt enables transparent encryp-
running yadm transcrypt or yadm git-crypt. These tools enables trans-
tion and decryption of files in a git repository. You can read
parent encryption and decryption of files in a git repository. See the
https://github.com/AGWA/git-crypt for details.
following web sites for more information:
- https://github.com/elasticdog/transcrypt
- https://github.com/AGWA/git-crypt
@ -643,7 +658,7 @@
automatically update the permissions of some file paths. The "group"
automatically update the permissions of some file paths. The "group"
and "others" permissions will be removed from the following files:
and "others" permissions will be removed from the following files:
- $HOME/.config/yadm/files.gpg
- $HOME/.local/share/yadm/archive
- All files matching patterns in $HOME/.config/yadm/encrypt
- All files matching patterns in $HOME/.config/yadm/encrypt
@ -712,30 +727,40 @@
a fully qualified path, this directory will be $XDG_CONFIG_HOME/yadm.
a fully qualified path, this directory will be $XDG_CONFIG_HOME/yadm.
Otherwise it will be $HOME/.config/yadm.
Otherwise it will be $HOME/.config/yadm.
Similarly, yadm's data files are relative to the "yadm data directory".
yadm uses the "XDG Base Directory Specification" to determine this
directory. If the environment variable $XDG_DATA_HOME is defined as a
fully qualified path, this directory will be $XDG_DATA_HOME/yadm. Oth-
erwise it will be $HOME/.local/share/yadm.
The following are the default paths yadm uses for its own data. Most
The following are the default paths yadm uses for its own data. Most
of these paths can be altered using universal options. See the OPTIONS
of these paths can be altered using universal options. See the OPTIONS
section for details.
section for details.
$HOME/.config/yadm
$HOME/.config/yadm
The yadm directory. By default, all data yadm stores is relative
The yadm directory. By default, all configs yadm stores is rela-
to this directory.
tive to this directory.
$HOME/.local/share/yadm
The yadm data directory. By default, all data yadm stores is
relative to this directory.
$YADM_DIR/config
$YADM_DIR/config
Configuration file for yadm.
Configuration file for yadm.
$YADM_DIR/alt
$YADM_DIR/alt
This is a directory to keep "alternate files" without having
This is a directory to keep "alternate files" without having
them side-by-side with the resulting symlink or processed tem-
them side-by-side with the resulting symlink or processed tem-
plate. Alternate files placed in this directory will be created
plate. Alternate files placed in this directory will be created
relative to $HOME instead.
relative to $HOME instead.
$YADM_DIR /repo.git
$YADM_DATA /repo.git
Git repository used by yadm.
Git repository used by yadm.
$YADM_DIR/encrypt
$YADM_DIR/encrypt
List of globs used for encrypt/decrypt
List of globs used for encrypt/decrypt
$YADM_DIR/files.gpg
$YADM_DATA/archive
All files encrypted with yadm encrypt are stored in this file.
All files encrypted with yadm encrypt are stored in this file.
@ -755,7 +780,7 @@
echo .ssh/*.key >> $HOME/.config/yadm/encrypt
echo .ssh/*.key >> $HOME/.config/yadm/encrypt
Add a new pattern to the list of encrypted files
Add a new pattern to the list of encrypted files
yadm encrypt ; yadm add ~/.config/yadm/files.gpg ; yadm commit
yadm encrypt ; yadm add ~/.local/share/yadm/archive ; yadm commit
Commit a new set of encrypted files
Commit a new set of encrypted files
@ -770,7 +795,7 @@
## SEE ALSO
## SEE ALSO
git(1), gpg(1)
git(1), gpg(1) openssl(1) transcrypt(1) git-crypt(1)
https://yadm.io/
https://yadm.io/