From: "J. Bakshi" Subject: Re: how to add files/folder from work-tree Date: Tue, 19 Jul 2011 13:52:24 +0530 Message-ID: <20110719135224.52c4301d@shiva.selfip.org> References: <20110719120048.3dd56eb6@shiva.selfip.org> <4E2537F8.6000506@gmail.com> <20110719133633.0797713d@shiva.selfip.org> <4E253C94.7000709@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "git@vger.kernel.org" To: Chris Packham X-From: git-owner@vger.kernel.org Tue Jul 19 10:22:34 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qj5ZX-0003UK-8v for gcvg-git-2@lo.gmane.org; Tue, 19 Jul 2011 10:22:31 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530Ab1GSIWV (ORCPT ); Tue, 19 Jul 2011 04:22:21 -0400 Received: from static.206.87.46.78.clients.your-server.de ([78.46.87.206]:34013 "EHLO Kolkata.infoservices.in" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752444Ab1GSIWT (ORCPT ); Tue, 19 Jul 2011 04:22:19 -0400 Received: from shiva.selfip.org (unknown [122.176.30.116]) by Kolkata.infoservices.in (Postfix) with ESMTPSA id 6F2623804001; Tue, 19 Jul 2011 10:22:16 +0200 (CEST) In-Reply-To: <4E253C94.7000709@gmail.com> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-pc-linux-gnu) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Tue, 19 Jul 2011 20:13:08 +1200 Chris Packham wrote: > Oops managed to drop the Cc for the mailing list from my initial response. > > On 19/07/11 20:06, J. Bakshi wrote: > > On Tue, 19 Jul 2011 19:53:28 +1200 > > Chris Packham wrote: > > > >> On 19/07/11 18:30, J. Bakshi wrote: > >>> Hello, > >>> > >>> I am using a git repo which has detached work tree. I like to add the files, folders located at the work tree ( it is a site under htdocs) at the git repo. Is it possible to do it within the work-tree or I need a separate working space from where I need to do all these operation ? > >>> > >>> Thanks > >>> > >>> -- > >> > >> I'm not sure I fully understand your question but what I _think_ you > >> want to do is specify the path to the repository with the GIT_DIR > >> environment variable. Like this > >> > >> cd /place/where/files/are > >> GIT_DIR=/place/were/repo/is/.git git add > >> > > > > > > I have set a git repo with attached work-tree with hook as below > > > > git -bare init /home/git/test.git > > cd /home/git/test.git > > git config core.worktree /var/www/test > > > > vim /home/git/test.git/hooks/post-receive > > > > #!/bin/sh > > git checkout -f > > > > Now the /var/www/test has already some files/folder. How can I add those to the repo within from its work-tree ? > > > > Thanks > > I think my initial response is correct. Try the following > > cd /var/www/test > git --git-dir=/home/git/test.git add > git --git-dir=/home/git/test.git commit -m "blah" > > Great !! Thanks