I have developed a web-app in PHP, and I have been using GIT in my local machine to source-control it.
Now I have a simple hosting at MediaTemple, and I’d like to publish my site, just using GIT. So, how do I do that?
I thought about making git init at the server and cloning my local repo, after that, I could set my local repo remote origin to be the server one, so all I have to do to publish is a git push origin master on my local machine. But I am concerned about how many .git/ folders and docs is my server going to have, and if that’s dangerous for the server.
I only want to have the needed files there, read: source files, not source control files.
Any suggestion? Or should I do it just this way and forget about hidden files?
Thanks in advance!!
When you do git push, your remote working directory is not updated (i.e.
git checkoutwill not automatically happen on the remote side). You can use git pull from the remote side like:if you have remote control of your server.