Git development
 help / color / mirror / Atom feed
* git checkout -f branch doesn't remove extra files
@ 2005-08-12 17:31 Luck, Tony
  2005-08-12 20:27 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Luck, Tony @ 2005-08-12 17:31 UTC (permalink / raw)
  To: git

I've just got around to noticing some of the new (to
me) features in git, and started experimenting with
branches.

I see that when I switch view to a different
branch with:

	$ git checkout -f someoldbranch

that any files that exist in my previous branch view
but not in "someoldbranch" are not deleted.  I can
find and remove them easily with:

	$ git-ls-files --others | xargs rm -f

but I wondered whether this was a deliberate choice
(to avoid clobbering .o files etc. for people who
have run a make in their tree).

Currently git-ls-files doesn't have a way to specify
a branch ... but it it did, the something like:

	comm -1 <(git-ls-files -b oldbranch) \
		  <(git-ls-files -b newbranch) | xargs rm -f

would clean up the spurious files.

-Tony

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

end of thread, other threads:[~2005-08-12 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-12 17:31 git checkout -f branch doesn't remove extra files Luck, Tony
2005-08-12 20:27 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox