If you're using Zero-Installs:
.yarn/* !.yarn/cache !.yarn/patches !.yarn/plugins !.yarn/releases !.yarn/sdks !.yarn/versions
If you're not using Zero-Installs:
.yarn/* !.yarn/patches !.yarn/releases !.yarn/plugins !.yarn/sdks !.yarn/versions .pnp.*
Questions & Answers
A list of answers to commonly asked questions.
https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

Seonglae Cho