1
0
Fork 0
mirror of synced 2024-11-14 21:48:57 -05:00
yadm/_docs/110_faq.md

240 lines
8.4 KiB
Markdown
Raw Normal View History

2016-09-06 23:19:16 -04:00
---
title: "Frequently Asked Questions"
permalink: /docs/faq
# TOC levels is dictated by toc_levels in _config.yml
# Update to front-matter TOC after upgrading MMistakes
2016-09-06 23:19:16 -04:00
---
{% include toc title="Categories" %}
2016-09-06 23:19:16 -04:00
## Usage
### I just cloned my repository and conflicting data was overwritten. Why?
2016-09-06 23:19:16 -04:00
2019-10-19 14:59:03 -04:00
Prior to cloning your repository, files managed by yadm already existed. For
2016-09-06 23:19:16 -04:00
example, imagine you are logged into a system and `$HOME/.bash_profile` already
2019-10-19 14:59:03 -04:00
exists. If you then clone your yadm repository—which also contains
`.bash_profile`—then you will likely get a conflict. Since version 1.07,
2019-10-19 14:59:03 -04:00
yadm responds by "stashing" these conflicts. To view the stashed data, you can
run `yadm stash show -p` from within your `$HOME` directory. If you want to
restore the stashed data, you can run `yadm stash apply` from within your
`$HOME` directory.
2016-09-06 23:19:16 -04:00
### While committing I got the message, _"Please tell me who you are"_. Why?
Whenever a Git commit is generated, Git requires information about the author of
the commit. This can be configured via the `git config` command. Usually the
best approach is to configure this information globally, and then manage your
2019-10-19 14:59:03 -04:00
global Git configuration via yadm. This allows the configuration to follow
you wherever your dotfiles live.
```
git config --global "user.email" "your-email@domain"
git config --global "user.name" "Your Name"
yadm add ~/.gitconfig
```
2019-10-19 14:59:03 -04:00
However, if you want commits to your yadm repo to use a different author,
you can configure these settings in the yadm repo itself.
```
yadm gitconfig "user.email" "alternate-email@domain"
yadm gitconfig "user.name" "Alternate Name"
```
2019-10-19 14:59:03 -04:00
Note: Configuring these settings directly in the yadm repo will require you
to configure it each time you clone the repo.
2016-09-06 23:19:16 -04:00
### How can I display untracked files with a `yadm status` command?
2019-10-19 14:59:03 -04:00
By default, yadm is configured to ignore untracked files when displaying a
2016-09-06 23:19:16 -04:00
status. You can use the `-u` paramter on the status command to alter how
untracked files are treated. `-unormal` will show untracked files and
directories.
```
yadm status -unormal
```
If you want to change the default treatment, you can change this configuration
2019-10-19 14:59:03 -04:00
on the yadm repository itself.
2016-09-06 23:19:16 -04:00
```
yadm gitconfig --unset status.showUntrackedFiles
```
### How can I stage all modified files at once?
Just as with Git, you can use the `add` command.
```
yadm add -u :/
```
(Starting with Git 2.0, the `:/` is not necessary)
2019-10-19 14:59:03 -04:00
### How can I change the URL of my remote yadm repository?
2016-09-06 23:19:16 -04:00
This is done the same way you change the URL of any Git repository.
```
yadm remote set-url origin <NEW-URL>
```
2019-10-19 14:59:03 -04:00
This could be useful if you manage your ssh keys in the yadm repository.
2016-09-06 23:19:16 -04:00
That could make it difficult to initially clone the repository using the `ssh`
protocol. You can start by cloning the repository using the `https` protocol
(and providing a password), and then change the repository's URL after you've
decrypted your ssh keys.
2019-10-20 16:07:13 -04:00
### I've customized yadm configurations (stored in `~/.config/yadm/config`). Should I add that to my repository?
2016-09-06 23:19:16 -04:00
2019-10-19 14:59:03 -04:00
Certainly. That is a good way to carry your yadm configurations around (just
2016-09-06 23:19:16 -04:00
like the rest of your dotfiles).
2019-10-19 14:59:03 -04:00
### Can you point to any example yadm managed repositories?
2016-09-06 23:19:16 -04:00
[This page](examples) contains some examples.
2017-02-05 17:39:31 -05:00
## Bootstrapping
### Do I need to write my bootstrap in Bash?
No. Any executable file can be used as a bootstrap. It's up to you to decide
what works best.
### I've created a bootstrap program. Should I add that to my repository?
Absolutely. That will allow your bootstrap program to be executed each time you
clone your repository. Read [bootstrap](bootstrap) for more details.
2016-09-06 23:19:16 -04:00
## Encryption
2019-10-19 14:59:03 -04:00
### Can I use yadm without gpg?
2016-09-06 23:19:16 -04:00
Of course. You only need `gpg` installed if you plan on using the
2019-10-19 14:59:03 -04:00
encrypt/decrypt features. yadm will tell you if it is missing a dependency
2016-09-06 23:19:16 -04:00
for any command.
2019-10-20 16:07:13 -04:00
### Should I `yadm add` my `.config/yadm/encrypt` file?
2016-09-06 23:19:16 -04:00
Yes! This way your configuration for what files should be encrypted will follow
you when you clone your repository.
### Should I `yadm add` encrypted files to repository?
No, you should not. Files you want encrypted should be added to the file
2019-10-20 16:07:13 -04:00
`.config/yadm/files.gpg` using the `yadm encrypt` command. Then
`.config/yadm/files.gpg` should be added to the yadm repository. This way, only
an encrypted collection of those files are put into the repository. After
cloning or updating your repository, you can use `yadm decrypt` to extract those
files from `.config/yadm/files.gpg`. See the
2016-09-06 23:19:16 -04:00
[encryption help](encryption) for more details.
2019-10-19 14:59:03 -04:00
### I modified an encrypted file, but yadm doesn't show any modifications. Why?
2016-09-06 23:19:16 -04:00
2019-10-20 16:07:13 -04:00
If you changed files which are matched by `.config/yadm/encrypt`, you must
re-run `yadm encrypt` to generate a new version of `.config/yadm/files.gpg`.
Then `.config/yadm/files.gpg` can be added to a new commit.
2016-09-06 23:19:16 -04:00
2017-01-20 18:30:49 -05:00
### Why do I get the error `Inappropriate ioctl for device` when encrypting.
If you get the error
`command get_passphrase failed: Inappropriate ioctl for device`
2019-10-19 14:59:03 -04:00
when running `yadm encrypt`, gpg is having trouble identifying the tty to
use. The environment variable `GPG_TTY` can be used to help gpg out. Export
2017-01-20 18:30:49 -05:00
this variable to your shell in your login scripts.
```
export GPG_TTY=$(tty)
```
2020-08-08 22:09:13 -04:00
### Can I use yadm with transcrypt or git-crypt?
2016-09-06 23:19:16 -04:00
2020-08-08 22:09:13 -04:00
Yes, yadm now supports both transcrypt and git-crypt.
Read more [here](/docs/encryption#transcrypt--git-crypt).
2016-09-06 23:19:16 -04:00
## Directory Creation
### Why are `.ssh` or `.gnupg` directories being created by yadm?
yadm is often used to track private data used by SSH and GnuPG. Because of this,
these directories are created with restricted permissions prior to Git
operations that could write data to those directories. This is to better protect
that sensitive data.
If you want to disable that feature, you can set the `auto-private-dirs`
configuration by running:
```
yadm config yadm.auto-private-dirs false
```
## Integrations
### Why does git-cola hang when run via `yadm enter`?
`git-cola` tries to display all of the untracked files in a repository. For
dotfiles, this is usually a massive list of files. The solution is to configure
your repo to have `git-cola` ignore untracked files with the following
configuration.
```
yadm gitconfig gui.displayuntracked false
```
## Unconventional Cases
### Can I use yadm to track system level files?
yadm only manages files within the configured worktree (`$HOME` by default).
Also, yadm will use the effective user for file ownership just like Git.
However, if you want to bend yadm into managing system files, one method is:
```
# create an alias to run yadm for system files
alias sysyadm="sudo yadm -Y /etc/yadm"
# initialize the yadm repo using the worktree of "/"
sysyadm init -w /
# or clone the yadm repo using the worktree of "/"
sysyadm clone -w / <url>
# continue to use sysyadm for managing system files
sysyadm add /etc/something.conf
sysyadm commit -m 'Add something.conf'
```
Assuming you have "sudo" rights, the `sysyadm` alias will work as if root was using
yadm, having the owner be "root", with the ability to manage any file under `/`.
If you were only interested in managing files under `/etc`, you could use that as
the worktree instead.
2016-09-06 23:19:16 -04:00
## Comparisons
2019-10-19 14:59:03 -04:00
### How does yadm differ from homeshick?
2016-09-06 23:19:16 -04:00
2019-10-19 14:59:03 -04:00
yadm and homeshick are both written in Bash, with very limited
dependencies. However, homeshick works by symlinking data from a repository
working directory into your `$HOME` directory. yadm instead uses your
`$HOME` directory _as_ its working directory. homeshick allows for multiple
"castles" to be linked into `$HOME`, while yadm is designed to work with a
single repository. homeshick requires you to change into the "castle"
directory before performing any Git based commands. yadm allows you to
perform operations regardless of your location. yadm also includes unique
2016-09-06 23:19:16 -04:00
features to encrypt private data, and symlink alternate versions of files based
on OS type or hostname.
2019-10-19 14:59:03 -04:00
### How does yadm differ from vcsh?
2016-09-06 23:19:16 -04:00
2019-10-19 14:59:03 -04:00
yadm and vcsh both work as a filters for standard Git commands. Both
2016-09-06 23:19:16 -04:00
also use your `$HOME` directory _as_ the repository's working directory.
2019-10-19 14:59:03 -04:00
However, vcsh is designed to work with multiple repositories, yadm
instead uses a single repository. vcsh requires you to specify which
repository you want to operate on, while yadm only operates on one. If you
want to use Git submodules, you _may_ have trouble using vcsh. This is
2016-09-06 23:19:16 -04:00
because only one repository can be the owner of the `.gitmodules` file.
2019-10-19 14:59:03 -04:00
yadm also includes unique features to encrypt private data, and symlink
2016-09-06 23:19:16 -04:00
alternate versions of files based on OS type or hostname.