I think that the functionality you are looking for can be achieved by having the branch used for deployment for your Cloud Provider.
Set up a dev branch that includes your .gitignore file, check your incremental work in this branch.
Merge the dev branch into the deploy branch, which does not contain a .gitignore file but contains a vendor directory.
After the merge is completed, click on the remote deployment server from the deploy branch.
source share