This seems like a question about how to use a tool, but I will attempt a conceptual answer anyhow.
Instead of creating your git repository using the same file structure as a real server, consider storing the files all in one folder, but arranged into sub folders to represent where they should go. You could include a shell script that acts as an installer.
Basically, Git is good at storing files and version control, but not good at deployment. This is why version control and the logic for deploying code and configuration are their own specialized tools.
An idea for the structure of the repository could be:
If in your home directory, a
git clone <your repo> would result in this file structure:
Then you can execute
install.sh with root permissions. This shell script could simply copy the files in
<your repo> to their respective locations on the real machine.
It is a good idea to separate the storage of code from the logic that deploys it. This allows you to use specialized tools that are good at their respective jobs.