VSCode use specific .git folder if no .git folder is present in project root

I’m using Git-based dotfiles managment:

  1. https://www.stefanjudis.com/notes/git-based-dotfile-management-without-symlinks/
  2. https://www.atlassian.com/git/tutorials/dotfiles

I have bare git repository in ~/Repositories/dotfiles and alias dotfiles='git --git-dir=$HOME/Repositories/dotfiles --work-tree=$HOME'

and dotfiles config --local status.showUntrackedFiles no

When I’m editing my dotfiles with VSCode it’s git doesn’t work because there is not .git folder in ~/.config/zsh for example it’s located in ~/Repositories/dotfiles which tracks ~/.

Can I make VSCode git extension use .git from ~/Repositories/dotfiles bare repository if there no .git folder present in project root? Basically a fallback .git.