One of the major reasons Kubernetes is a thing is because all of your deployment can be declarative. Deploy-via-Git means I can destroy my entire world and bring it back in a minute or less.
If you have code that needs to compile, pull in packages, load configuration or for any other reason can't just run in production from a clean checkout, then the proper way is to go through a CI server (teamcity, Jenkins, Travis, etc), and have a script that gets from your clean checkout to a package/zip that runs in production.
One of the major reasons Kubernetes is a thing is because all of your deployment can be declarative. Deploy-via-Git means I can destroy my entire world and bring it back in a minute or less.