git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Wesley J. Landaker" <wjl@icecavern.net>
To: Phillip Susi <psusi@cfl.rr.com>, git@vger.kernel.org
Subject: Re: No working tree repository
Date: Tue, 15 Jun 2010 14:41:34 -0600	[thread overview]
Message-ID: <201006151441.35554.wjl@icecavern.net> (raw)
In-Reply-To: <4C17C77C.9000002@cfl.rr.com>

[-- Attachment #1: Type: Text/Plain, Size: 1084 bytes --]

On Tuesday, June 15, 2010 12:33:32 Phillip Susi wrote:
> Ahh, that's the magic word I was groping for.
> 
> It seems that --bare on clone will prevent the checkout of the local
> working tree.  If I decide I do want the sources today I can just check
> them out, but what is the proper way to do the reverse?  I was thinking
> something like somehow empty the index file then do a git-reset or
> git-checkout-index to clean up the working tree to match the empty
> index, but I can't figure out how to empty the index.

I often want to have a regular tree, but only sometimes check it out, and I 
want it to be in-place (e.g. not a bare repository and a separate work-
tree).

What I do is I make a local "empty" branch with no files or ancestory. For 
this I have a "git-emptybranch" script (attached), but you can easily do 
this by hand.

Then when I want files, I do:

$ git checkout master  ## or whatever branch

When I'm done, I do

$ git checkout empty

and all the files go away.

Even with empty checked out, I can fetch, push, run gitk --all, etc.

This works well for me.

[-- Attachment #2: git-emptybranch --]
[-- Type: application/x-shellscript, Size: 322 bytes --]

  reply	other threads:[~2010-06-15 20:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-15 17:56 No working tree repository Phillip Susi
2010-06-15 18:10 ` Matthieu Moy
2010-06-15 18:33   ` Phillip Susi
2010-06-15 20:41     ` Wesley J. Landaker [this message]
2010-06-15 20:58     ` Matthieu Moy
2010-06-16  6:20     ` Johannes Sixt
2010-06-16  8:36     ` Peter Krefting
2010-06-15 19:39   ` Andreas Schwab

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=201006151441.35554.wjl@icecavern.net \
    --to=wjl@icecavern.net \
    --cc=git@vger.kernel.org \
    --cc=psusi@cfl.rr.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).