From 29b2eaa2171171f148f1489a3d1aa42eee26e705 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Mon, 4 Sep 2023 16:17:07 +0300 Subject: [PATCH] fix(cli/dotfiles): add an exception for `.gitconfig` (#9515) * fix(cli/dotfiles): Only ignore .git directory Resolves #8306 * fix fmt * add exception for .gitconfig * Update dotfiles.go --- cli/dotfiles.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/dotfiles.go b/cli/dotfiles.go index 635a3add33..88d57c7089 100644 --- a/cli/dotfiles.go +++ b/cli/dotfiles.go @@ -176,8 +176,8 @@ func (r *RootCmd) dotfiles() *clibase.Cmd { var dotfiles []string for _, f := range files { - // make sure we do not copy `.git*` files - if strings.HasPrefix(f.Name(), ".") && !strings.HasPrefix(f.Name(), ".git") { + // make sure we do not copy `.git*` files except `.gitconfig` + if strings.HasPrefix(f.Name(), ".") && (!strings.HasPrefix(f.Name(), ".git") || f.Name() == ".gitconfig") { dotfiles = append(dotfiles, f.Name()) } }