I don't see this as a being a good idea and would advise against it in any environment especially if this is a production website. The latest modules will have dependencies on other dev modules including the framework itself and depending on the amount of changed code probably would just not work.
That being said, my first thought would be to clone the Github repo, copy the existing module from the repo app/code/Magento/<module_name>
, and replace the module in the vendor directory at <magento_root>/vendor/magento/<module_name>
on your Magento server.
Also see this answerthis answer about using Github with composer.