# checkout w/ removing untracked files

3 messages from 2010-08-18 to 2010-08-23. Participants: Enrico Weigelt, Junio C Hamano.
Thread: https://gitlist.dev/t/24785

## Enrico Weigelt, 2010-08-18 19:31

Subject: checkout w/ removing untracked files
Message-ID: <20100818193154.GA13204@nibiru.local>
URL: https://gitlist.dev/e/20100818193154.GA13204%40nibiru.local

```

Hi folks,

is there an option to do a checkout _exactly_ as the ref'ed tree ?
(so, also remove untracked files) ?

For my Briegel buildsystem (git://pubgit.metux.de/projects/briegel.git/)
I need to checkout a really tree (iow: no untracked files may be
left in the workdir) from git. ATM I'm removing and recreating the
whole directory first, but I hope to get rid of this step.


cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------

```

## Junio C Hamano, 2010-08-18 19:51

Subject: Re: checkout w/ removing untracked files
Message-ID: <7v39ubaedg.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v39ubaedg.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20100818193154.GA13204@nibiru.local>

```
Enrico Weigelt <weigelt@metux.de> writes:

> For my Briegel buildsystem (git://pubgit.metux.de/projects/briegel.git/)
> I need to checkout a really tree (iow: no untracked files may be
> left in the workdir) from git. ATM I'm removing and recreating the
> whole directory first, but I hope to get rid of this step.

(1) If you have a correctly working "make reallyclean" to remove build
    artifacts, you wouldn't even need such an option.

(2) Have you tried to read up on "git clean -dfqx"?

```

## Enrico Weigelt, 2010-08-23 12:12

Subject: Re: checkout w/ removing untracked files
Message-ID: <20100823121229.GA12810@nibiru.local>
URL: https://gitlist.dev/e/20100823121229.GA12810%40nibiru.local
In-Reply-To: <7v39ubaedg.fsf@alter.siamese.dyndns.org>

```
* Junio C Hamano <gitster@pobox.com> wrote:
> Enrico Weigelt <weigelt@metux.de> writes:
> 
> > For my Briegel buildsystem (git://pubgit.metux.de/projects/briegel.git/)
> > I need to checkout a really tree (iow: no untracked files may be
> > left in the workdir) from git. ATM I'm removing and recreating the
> > whole directory first, but I hope to get rid of this step.
> 
> (1) If you have a correctly working "make reallyclean" to remove build
>     artifacts, you wouldn't even need such an option.

I can't rely on that. Some of the trees aren't even sourcetrees 
but sysroot images. I need a guaranteed fresh tree w/o any 
user intervention.


> (2) Have you tried to read up on "git clean -dfqx"?

Thanks, that should do it :)


cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------

```
