git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git with detached worktrees , push has no effect

From
JBJ. Bakshi <joydeep@infoservices.in>
Date
Jul 14, 2011, 12:40 UTC
Message-ID
<20110714181019.2453e3a8@shiva.selfip.org>
Hello list,
I have set the git bare repo with detached worktree to update website with post-receive hook. In short what I have done

[1] create the bare git with hook -------------------------------------

git init --bare /home/git/web.git

cat > home/git/web.git/hooks/post-receive #!/bin/sh GIT_WORK_TREE=/opt/web git checkout -f

chmod +x /home/git/web.git/hooks/post-receive
chown -rvf wwwrun:www /home/git/web.git

[2] create the directory and set permission --------------------------------------------

mkdir /opt/web chown -Rvf wwwrun:www /opt/web

[3] cloning at my clinet and push -----------------------------------

 git clone http://192.168.1.1/git/web.git

Cloning into web... Username: Password: warning: You appear to have cloned an empty repository.

 touch A
 git add A
 git commit -m "add A"
[master (root-commit) 7662edd] add A
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 A
 git push
 Username:
 Password:
 Everything up-to-date
Why reports  [Everything up-to-date] rather than modify the remote git ?
Confused :-( 
Next: Carlos Martín Nieto
Message 1 of 5 in “git with detached worktrees , push has no effect”
  1. J. BakshiJul 14, 2011
  2. Carlos Martín NietoJul 14, 2011
  3. J. BakshiJul 15, 2011
  4. J. BakshiJul 15, 2011
  5. Carlos Martín NietoJul 15, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.