Question: I have a remote repo in which I want to commit certain files (the compiled files to deploy them on a cloud computing platform), but I don't want to deploy them on github...

is there some way to have to different .gitignore files, one for each remote?

Answer: 
An **automated solution** to the methods mentioned here:

1. Set up the root .git to ignore the subfolder(s) you you want transmitted differently
2. Init new git within the subfolder(s) and assign the remote configuration
3. Modify the root folder's .git/hooks/pre-push file to exec git push at those sub folders based on the incoming arguments.
Another option is [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules).

This can be useful if, for instance, you want your code and documentation to be in two different repos with independent access control, etc. So you'd have 3 total repos, a submodule repo for docs, another for code, and the "master" (not a git submodule) repo containing both (for pypi upload, perhaps). This is a decent way to organize a CS textbook project. Both projects can proceed merrily ahead independently and sync up at major releases, driven by the master repo maintainer.