Dotfile management with bare git repo - question about gitignore

Viewed 286

This is based on https://www.atlassian.com/git/tutorials/dotfiles.

I don't understand this part: echo ".cfg" >> .gitignore

It seems to be adding the dotfiles folder (in this case .cfg/) to ~/.gitignore (home directory). Why? It says it's to avoid recursion. However, that step is not listed when setting up your dotfiles folder/repo for the first time. It's only included when installing on another machine. Why is it necessary on every machine except the first? Was it a missed step in setup, or is it actually unnecessary on subsequent installs, or is it for some reason required when installing but not during initial setup?

0 Answers
Related