No, you need to delete the .git folder from your server entirely. Ideally, delete it before you deploy. In fact, don't even put a github deploy key on the server. Deploy binaries.
And don't just stop with .git: Delete any folder/file that's not required to operate the app in production.