I might probably just have a lack of basic git knowledge, but I need some help here to make that clear.
I have a local git repo. I also have a webserver on which I want to deploy my code.
My thoughts are to init a git repo on the webserver (probably a bare one since I don't want to make any changes there directly) and then add that repository as a remote to my local one.
So I executed git init --bare my-repo.git
on my webserver, added the remote with git remote add develop ssh://user@webserver/path/to/git-repo/my-repo.git
.
So far so good, I can now successfully push my changes to my webserver with git push develop develop
. I can also see the pushed commits there with git log develop
.
The problem now is that I can't see my project files there. Of course I can't, because there is no work-tree since it is just a bare repo. But how in heaven can I make the project (which is a web page containing an index.php, etc.) visible?
Edit: My problem was not (as suggested by a "possible dublicate"-request) my missing knowledge about the difference of a bare and a regular repo. My problem was the correct usage of a checkout with manually set work-tree and git-dir as well as the needed folder structure for it. Thanks to @muecas's comment I got it.