All of lore.kernel.org
 help / color / mirror / Atom feed
* List of directories containing only ignored files
@ 2011-10-06 13:56 Marcin Wiśnicki
  2011-10-06 14:03 ` Andreas Ericsson
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Wiśnicki @ 2011-10-06 13:56 UTC (permalink / raw)
  To: git

What's the easiest way to find all directories that contain only
ignored files but are not ignored themselves.

For example, given following .gitignore:

  obj/

and following files:

  /project1/foo.c
  /project1/obj/foo.o
  /project2/obj/bar.o

Where /project2 contains leftovers from different branch that are not
cleared on switch because they are ignored.

I would like to see:

  /project2


Alternatively: how to remove such leftovers when switching branches ?

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

* Re: List of directories containing only ignored files
  2011-10-06 13:56 List of directories containing only ignored files Marcin Wiśnicki
@ 2011-10-06 14:03 ` Andreas Ericsson
  2011-10-06 14:32   ` Marcin Wiśnicki
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Ericsson @ 2011-10-06 14:03 UTC (permalink / raw)
  To: Marcin Wiśnicki; +Cc: git

On 10/06/2011 03:56 PM, Marcin Wiśnicki wrote:
>
> Alternatively: how to remove such leftovers when switching branches ?

git clean -X -f

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

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

* Re: List of directories containing only ignored files
  2011-10-06 14:03 ` Andreas Ericsson
@ 2011-10-06 14:32   ` Marcin Wiśnicki
  0 siblings, 0 replies; 3+ messages in thread
From: Marcin Wiśnicki @ 2011-10-06 14:32 UTC (permalink / raw)
  To: git

2011/10/6 Andreas Ericsson <ae@op5.se>:
> On 10/06/2011 03:56 PM, Marcin Wiśnicki wrote:
>>
>> Alternatively: how to remove such leftovers when switching branches ?
>
> git clean -X -f
>

That also would delete /project1/obj/foo.o which is not what I wanted.

Anyway I think I have found the answer:

 git ls-files -o --directory --exclude-standard

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

end of thread, other threads:[~2011-10-06 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 13:56 List of directories containing only ignored files Marcin Wiśnicki
2011-10-06 14:03 ` Andreas Ericsson
2011-10-06 14:32   ` Marcin Wiśnicki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.