Free Microsoft GH-300 Actual Exam Questions - Question 3 Discussion

Question No. 3
What is the correct way to exclude specific files from being used by GitHub Copilot Business during
code suggestions?
Select one option, then reveal solution.
US
PR
Paul R.
2026-02-22

B. The copilot.ignore file is specifically designed for excluding files from suggestions, which makes it the most direct method. Since .gitignore only affects Git behavior and not Copilot, A doesn’t really apply. Also, changing filenames like in D seems unreliable and is more of a workaround than a proper solution. C might cover broader exclusions but not at the granular file level like copilot.ignore does.

0
IX
Irfan X.
2026-02-19

It’s B, since .gitignore only affects Git, not Copilot’s suggestion scope.

0
AB
Ash B.
2026-02-01

I think option C can be dropped because the settings UI generally covers broader scopes, not file-level exclusions. Also, D feels like a hack rather than a supported way to stop Copilot from suggesting on certain files. That leaves B as the most logical choice since copilot.ignore sounds purpose-built for this. A (.gitignore) is definitely not relevant here because it only tells Git what to ignore, not Copilot. So, B makes the most sense to me.

0
MB
Mason B.
2026-01-31

B. The .gitignore file is mainly for Git itself, so it won't stop Copilot from suggesting code. The UI settings (option C) usually cover general scopes and not specific files, so that’s probably not it. The copilot.ignore file is designed for excluding files, and even if wildcard support is limited, it’s the only official way to tell Copilot to skip certain files. Renaming files (D) sounds like a workaround, not a supported feature. So B makes the most sense here as the proper method.

0
MB
Mason B.
2026-01-29

Option C seems off since UI settings usually handle broader categories, not specific files. That leaves option B as the only one explicitly made for excluding files from Copilot suggestions.

0
SH
Shoaib H.
2026-01-27

Makes sense to rule out A since .gitignore won’t affect Copilot’s suggestions at all. D seems unlikely too because renaming files to exclude them feels like a hack, not an official method. Between B and C, I’d say if the feature is meant to be customizable per repo, a copilot.ignore file (B) sounds more plausible for specifying exact files or patterns to exclude, rather than relying on UI settings that might only handle broad exclusions. So I’d go with B here.

0
SH
Shoaib H.
2026-01-24

I’m doubtful about A because .gitignore just controls what’s tracked by git, not Copilot’s behavior. D also feels like a hacky workaround. So it’s probably between B and C, but does the UI really allow file-level exclusions?

0
AJ
Ahmed J.
2026-01-24

Probably B. The name “copilot.ignore” sounds like it’s designed specifically for this purpose, unlike .gitignore which is more about version control. Renaming files with a suffix seems odd and less practical. The UI settings might work for general exclusions, but I think the most precise way is having a dedicated ignore file that tells Copilot exactly what to skip. This would make managing exclusions easier across different projects too.

0
IF
Irfan F.
2026-01-23

C The UI settings usually let you set exclusions without touching repo files, which is handy for quick changes. It might not be as granular as copilot.ignore but works well for broader filters.

0
HJ
Hassan J.
2026-01-21

Maybe C could work too since some tools let you manage exclusions directly in settings. If you want to avoid messing with files in the repo, adjusting user interface options might be cleaner. I’m not sure if it’s file-specific though, but seems plausible as an alternative to copilot.ignore. Just feels like .gitignore is unrelated here, and renaming files sounds a bit hacky.

0
ML
Mohammad L.
2026-01-17

A imo, .gitignore is about ignoring files from Git tracking, not Copilot suggestions. So it wouldn’t stop Copilot from using those files for code completions.

0
ML
Mohammad L.
2026-01-15

It’s B. The copilot.ignore file is designed exactly for that purpose—excluding specific files from suggestions without messing with gitignore or renaming files.

0
AK
Ahmed K.
2026-01-13

Pretty sure it's C. You can exclude files directly from the GitHub Copilot settings in the UI.

0