mkdir -p ~/.config/git
mv ~/.gitconfig ~/.config/git/config
mv ~/.git-credentials ~/.config/git/credentials
ln -s ~/.config/git/config ~/.gitconfig
ln -s ~/.config/git/credentials ~/.git-credentials
That keeps your current config in place and working while placing your files in a logical place for access (in fact, if you set
XDG_CONFIG_HOME
to ~/.config
you won't need to do the symbolic links).
I put it in my home directory and then set CROSS_CONFIG
to point to it - but you'll need to figure out the best approach for you.
[build.env]
passthrough = ["XDG_CONFIG_HOME=/home/your-user-id/.config"]
volumes = ["/home/your-user-id/.config=/home/your-user-id/.config"]
That gives Cross access to your .config
folder and sets the XDG_CONFIG_HOME
environment variable appropriately within the container,
giving GIT access to your host config.