Skip to content

Commit 29b2eaa

Browse files
authored
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
1 parent aa94d89 commit 29b2eaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cli/dotfiles.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ func (r *RootCmd) dotfiles() *clibase.Cmd {
176176

177177
var dotfiles []string
178178
for _, f := range files {
179-
// make sure we do not copy `.git*` files
180-
if strings.HasPrefix(f.Name(), ".") && !strings.HasPrefix(f.Name(), ".git") {
179+
// make sure we do not copy `.git*` files except `.gitconfig`
180+
if strings.HasPrefix(f.Name(), ".") && (!strings.HasPrefix(f.Name(), ".git") || f.Name() == ".gitconfig") {
181181
dotfiles = append(dotfiles, f.Name())
182182
}
183183
}

0 commit comments

Comments
 (0)