0

I have setup a repository in Github. I have used SSH protocol to establish connection to that repo in my web hosting. Then I have cloned the repo without the project folder like this.

git clone git@github.com:{username}/{git-name} .

All works without any problem.

Now, I want to use that repo as the final copy of my website i.e. every time I update the repo, my website will also be updated. So, I created a PHP script which contains

`git pull`

I put the script link as web hook url in Github settings. But nothing happens when I update my repo.

I don't understand what's the problem. Is it because I have cloned the site without repository folder?

Another problem is that, the .git folder is present inside the main website which means everyone can access that. Is there any solution to that?

I am pretty much new to Git and Github. So, detailed instruction will be very helpful. I am using Shared hosting with SSH shell access.

sakibmoon
  • 2,026
  • 3
  • 22
  • 32

1 Answers1

0

You didn't told git which branch you want to pull. So git pull <your-branch> should fix that problem.

With a .htaccess file within the .git folder you can refuse access to it:

Order Allow,Deny
Deny from All
  • I am not looking for this solution. Something that would help me to put my git in a level up or something like that. – sakibmoon Oct 27 '13 at 17:53