I have a managed package that I am testing in my sandbox from the App Exchange. I am also writing some custom classes that depend on resources in this managed package. I want to track these changes in my repository in order to promote this to higher environments. Are there any best practices for tracking managed packages in a git repo? Should I only pull down the resources my custom code depends on? Is there an SFDX command that would pull the entire package down into my project?
Only track your source code (the custom classes) that you have created in your git repo. The managed package being installed is then just a pre-requisite of being able to deploy your code.
The install of a managed package can be scripted:
sfdx force:package:install --package <<version id>> --installationkey <<password>> --wait 20
and running that can be documented as a pre-requisite.