TortoiseGit Shell Extension and Git for Windows: which ignore file does "Add to ignore list" actually update?
0 reputation · 02 Jun 2021, 20:34 UTC
Goal
I want a predictable way to manage ignore rules from TortoiseGit's context menu so that files ignored via the GUI behave identically to files ignored by editing .gitignore from the Git CLI. The two components involved are the TortoiseGit Windows Shell Extension and the Git for Windows binary it wraps (TortoiseGit 2.x with a current Git for Windows installation).
Constraints and uncertainty
TortoiseGit offers ignore actions from the Explorer context menu, and Git itself supports at least two distinct mechanisms: the versioned .gitignore file and the repository-local .git/info/exclude file, which is not shared with other clones. It is not clear to me which of these the GUI's ignore action writes to, whether the behavior is configurable, and whether it differs between ignoring a single file and ignoring by wildcard or extension. I also want to avoid a situation where a teammate cloning the repository does not inherit the ignore rules I created through the GUI.
Questions
- Does TortoiseGit's "Add to ignore list" action write to
.gitignore,.git/info/exclude, or does it offer both, and is this documented behavior? - Is there a TortoiseGit setting that controls which ignore target is used, and does it apply per repository or globally?
- Does the chosen target differ for wildcard ignores versus single-file ignores?