Add info about .gitconfig to README

This commit is contained in:
Jeena 2026-03-05 21:10:27 +09:00
parent a9a645abca
commit bfcb79a890

View file

@ -55,6 +55,26 @@ The image is built automatically on first use if it does not already exist.
Claude Code starts inside the container with the current directory mounted and Claude Code starts inside the container with the current directory mounted and
set as the working directory. set as the working directory.
## Sharing host config files via hard links
The container home at `~/.local/share/claude-container/container-home/` is mounted
as `/home/<username>` inside every container. You can hard link files from your real
`$HOME` into this directory so the container sees them without copying or syncing.
Because both paths live on the same filesystem, a hard link means they are literally
the same file — changes from either side are instantly reflected.
Example for `.gitconfig`:
```sh
mkdir -p ~/.local/share/claude-container/container-home
ln ~/.gitconfig ~/.local/share/claude-container/container-home/.gitconfig
```
You can do the same for other config files you want to share. Avoid linking
sensitive files such as `~/.ssh/id_*` or `~/.gnupg/` — keeping those out of the
container is an intentional security boundary.
## Cleanup ## Cleanup
To remove all containers, the image, and the persistent home directory: To remove all containers, the image, and the persistent home directory: