Skip to contentSkip to conversation

checkout w/ removing untracked files

DISCUSSION Enrico Weigelt 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

Signature · 8 lines
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
#1 lore raw
Quoted 4 lines · Enrico Weigelt

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"?

#2 lore raw
Quoted 9 lines · Junio C Hamano
Quoted 4 lines · Enrico Weigelt

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.

Quoted 1 line

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

Thanks, that should do it :)

cu

Signature · 8 lines
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------