Reputation: 21
I want my git repo to be in a separate directory from my working directory, so I made a repo using the following commands:
$ cd mysite.git/
$ git init --bare
Initialized empty Git repository in /home/git/mysite.git
$ git config core.bare false
$ git config core.worktree /home/mysite/public_html
$ git config receive.denycurrentbranch ignore
$ cat > hooks/post-receive
#!/bin/sh
export GIT_DIR=/home/git/mysite.git
export GIT_WORK_TREE=/home/mysite/public_html
git checkout -f
^D
$ chmod +x hooks/post-receive
I seem to be able to push and pull from the repo without error, but the working directory doesn't reflect the pushed changes.
If I do
$ git status
it shows that my changes were commited, but then removed from the working directory.
This configuration was working for my team until recently, and I'm not sure how to track down what might have changed. I've made sure that the file permissions seem to be correct. I'm not sure what else to check.
Can someone please help me figure out why my configuration is causing the working directory to not reflect the commited changes?
Upvotes: 1
Views: 255
Reputation: 21
It turns out that the permissions in my repo directory were correct, but the permissions in my working directory were not. I had to make sure that the working directory was writable by the user that was doing the push.
Upvotes: 1