Is it ok/legal to publish my game on GitHub?

It you mean to include Unreal Engine source code and make available to the general public, no that’s not permitted. If you mean to include Unreal Engine source code but only to users of Epic’s UnrealEngine GitHub network, yes that’s permitted. If you don’t mean to include Unreal Engine source code and make available to the general public, yes that’s permitted.

Same answers for marketplace content, but replace “Unreal Engine source code” with “marketplace content that is not inseparably incorporated into your product.”

The Git source control tutorial describes how to use Git with UE projects. So: Is it ok/legal to publish my game on GitHub? What about assets from the starter content/examples (e.g. ShooterGame)/marketplace?

Off topic: It would be nice to describe .gitignore in that tutorial.

Thank you. Regarding the UE source code itself was clear to me from the FAQ/EULA.
What if I have a material from the starter content?

If by starter content you mean Learning tab content, that’s treated the case as Marketplace content (needs to be inseparably embedded into the product in order to be distributed to the public).

I mean the Starter Content which you can select when you setup a new project and the content from within the templates (e.g. the weapon mesh/animations from the first person template).

You can’t share that with the general public in a way that would allow them to use it in their own projects.