sloppy
sloppy

Reputation: 311

VSCode set .git for dotfiles (bare repo that tracks `~/`)

Use specific .git folder if no .git folder is present in project root or, even better, when current folder matches certain paths (ex: ~/.config/**/*, ~/.local/share/**/*)

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 git integration doesn't work because there is not .git folder in ~/.config/zsh, for example, it's located in ~/Repositories/dotfiles which tracks ~/.

The folder currently open
doesn’t have a Git
repository. You can
initialize a repository
which will enable source
control features powered by
Git.

Can I make VSCode git integration use .git from ~/Repositories/dotfiles bare repository either when there no .git present in project root ("fallback" method) or when project root matches certain paths (ex: ~/.config/**/*)?

Upvotes: 0

Views: 37

Answers (0)

Related Questions