Accessing git config from a strict snap

Sure, but there are two things at play there: the information might contain sensitive information that shouldn’t be available to snaps and these dot directories are used by the programs from the hostfs and there are no guarantees that the host app and the snap command can handle each others’ configuration.

In the specific case of .gitconfig, the global .gitconfig can contain sensitive information. Please see Classic confinement for git-todos - #10 by jdstrand for a discussion of this particular issue.