According to the Composer documentation, you shouldn't commit to version control any of the files in packages that are managed by Composer. For a Drupal project, that means the following folders are not in your git repository:
- vendor
- web/core
- web/modules/contrib
Bluntly, I think this is the wrong thing to do. Doing the exact opposite saves you time, effort, heartache, and energy.
Let's start by comparing the two workflows.