git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git for local web development
@ 2009-04-17  0:56 William DiNoia
  0 siblings, 0 replies; 7+ messages in thread
From: William DiNoia @ 2009-04-17  0:56 UTC (permalink / raw)
  To: git

Hello,

I am having a bit of trouble trying to setup git for web development.
I would like to have a git repository in /var/www/sites which I can clone and
work on from my ~/Desktop. Working from the desktop clone, I would like to be
able to git-push and have the work tree updated. It seems this is a common
request as it is in the FAQ entitled, Why won't I see changes in the remote
repo after "git push"?

This is what I've done...

as www-data from /var/www/sites/

$mkdir test.com
$cd test.com
$git-init
$git-config core.worktree /var/www/sites/test.com
$vim .git/hooks/post-receive
#!/bin/sh
git-checkout -f
$chmod +x .git/hooks/post-receive

Then as william from /home/william/Desktop/

$git-clone /var/www/sites/test.com
$cd test.com
$vim index.html
testing, testing, 1,2
$git-add index.html
$git-commit
$git-push origin master

Something like the following is returned, and the work tree at
/var/www/sites/test.com is not updated

Counting objects: 5, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 277 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /var/www/sites/test.com/.git
   9b490a2..5e5cc63  master -> master
error: unable to unlink old 'index.html' (Permission denied)
error: hooks/post-receive exited with error code 1

The interesting part is that if I change to /var/www/sites/test.com and run
"git-checkout -f" it updates the work tree...
Should I be using a different hook? 

^ permalink raw reply	[flat|nested] 7+ messages in thread
* git for local web development
@ 2009-04-16 23:04 William DiNoia
  2009-04-17 11:59 ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: William DiNoia @ 2009-04-16 23:04 UTC (permalink / raw)
  To: git

Hello,

I am having a bit of trouble trying to setup git for web development. I would like to have a git repository in /var/www/sites which I can clone and work on from my ~/Desktop. Working from the desktop clone, I would like to be able to git-push and have the work tree updated. It seems this is a common request as it is in the FAQ, Why won't I see changes in the remote repo after "git push"?

This is what I've done...

as www-data from /var/www/sites/

$mkdir test.com
$cd test.com
$git-init
$git-config core.worktree /var/www/sites/test.com
$vim .git/hooks/post-receive
 #!/bin/sh
 git-checkout -f
$chmod +x .git/hooks/post-receive

Then as william from /home/william/Desktop/

$git-clone /var/www/sites/test.com
$cd test.com
$vim index.html
 testing, testing, 1,2
$git-add index.html
$git-commit
$git-push origin master

Something like the following is returned, and the work tree at /var/www/sites/test.com is not updated

Counting objects: 5, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 277 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /var/www/sites/test.com/.git
   9b490a2..5e5cc63  master -> master
error: unable to unlink old 'index.html' (Permission denied)
error: hooks/post-receive exited with error code 1

The interesting part is that if I change to /var/www/sites/test.com and run "git-checkout -f" it updates the work tree...
Should I be using a different hook? 
Is there something wrong with the script?
Is there a better, more elegant way to achieve updating of the work tree? 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-04-17 22:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-17  0:56 git for local web development William DiNoia
  -- strict thread matches above, loose matches on Subject: below --
2009-04-16 23:04 William DiNoia
2009-04-17 11:59 ` Jeff King
2009-04-17 15:44   ` William DiNoia
2009-04-17 18:30     ` Jeff King
2009-04-17 18:48       ` Martin Langhoff
2009-04-17 22:00       ` William DiNoia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).