What is the correct way to set up a staging server and use github for version control?

Usually people don’t create a repo for their entire site. Instead, they typically will create a repo for each theme and plugin.

So, you’ll have a staging site where you can edit your theme (or child theme) files and keep those all in a repo. Once everything looks good on staging, you can then push from the repo to the live site. The trickiest part is usually dealing with the database, because there are many places WP will set the URL in the database, and some of these are serialized, meaning if you do a simple search and replace, you’ll end up breaking the site. But if you’re not doing much data work that has to be pushed back and forth between sites, usually the file push to git and then just pushing from git to both your staging site and your live site is typically a good way to version your code and test things before they go live.

You can get even more fancy and use Github Actions to automatically deploy to your live site, but it all depends on whether you need that level of automation or not.