1

I want to set up a git environment for my PHP website. In my centos server, I created a directory and using git init --bare --shared to initial the git repository. Then I run git add . and git commit.

In my laptop, i use net beans IDE to get a clone of the git repository through SSH. I added some files and commit, push. It seems no problems.

My question is why I can not see any changes happened in my centos server. In the original repository, there are nothing changed. Do I need to run some commands?

Thanks in advance!

Tester
  • 798
  • 2
  • 12
  • 32

1 Answers1

0

It is a bare repo, which means it has no working tree, no visible files.

See "all about "bare" repos".

You would need to add a post-receive hook to your bare repo in order to update a live site (like this one).

GIT_WORK_TREE=/path/to/your/site git checkout -f

See the full script in "unable to set GIT_WORK_TREE variable in a bare repository when using post_update hook".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250