git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bakshi" <joydeep@infoservices.in>
To: unlisted-recipients:; (no To-header on input)
Cc: Chris Packham <judge.packham@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: how to add files/folder from work-tree
Date: Wed, 20 Jul 2011 16:22:08 +0530	[thread overview]
Message-ID: <20110720162208.3fa89d8b@shiva.selfip.org> (raw)
In-Reply-To: <20110720154644.67974a7f@shiva.selfip.org>

On Wed, 20 Jul 2011 15:46:44 +0530
"J. Bakshi" <joydeep@infoservices.in> wrote:

> On Tue, 19 Jul 2011 20:13:08 +1200
> Chris Packham <judge.packham@gmail.com> 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 <judge.packham@gmail.com> 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 <file>
> > >>
> > > 
> > > 
> > > 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 <files>
> 
> But this response as
> 
> ````
> fatal: This operation must be run in a work tree
> `````````

OK, need to append also --work-tree=/var/www/test

      reply	other threads:[~2011-07-20 10:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19  6:30 how to add files/folder from work-tree J. Bakshi
     [not found] ` <4E2537F8.6000506@gmail.com>
     [not found]   ` <20110719133633.0797713d@shiva.selfip.org>
2011-07-19  8:13     ` Chris Packham
2011-07-19  8:22       ` J. Bakshi
2011-07-20 10:16       ` J. Bakshi
2011-07-20 10:52         ` J. Bakshi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110720162208.3fa89d8b@shiva.selfip.org \
    --to=joydeep@infoservices.in \
    --cc=git@vger.kernel.org \
    --cc=judge.packham@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).