* Easy way to empty working tree?
@ 2006-07-21 1:28 Robin Luckey
2006-07-21 2:48 ` Linus Torvalds
0 siblings, 1 reply; 3+ messages in thread
From: Robin Luckey @ 2006-07-21 1:28 UTC (permalink / raw)
To: git
I have some very large git repositories that serve mainly as archives,
and it would be nice to clear out the working directories for the
repositories I am not currently working with. I'm not trying to delete
the files from the repository, I just want free up space in idle
repositories.
After mothballing the repository with git-repack -a -d and git clean
-d -x, is there a convenient one-liner to empty the files out the
working directory?
Thanks,
Robin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Easy way to empty working tree?
2006-07-21 1:28 Easy way to empty working tree? Robin Luckey
@ 2006-07-21 2:48 ` Linus Torvalds
2006-07-21 7:08 ` Alex Riesen
0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2006-07-21 2:48 UTC (permalink / raw)
To: Robin Luckey; +Cc: git
On Thu, 20 Jul 2006, Robin Luckey wrote:
>
> I have some very large git repositories that serve mainly as archives,
> and it would be nice to clear out the working directories for the
> repositories I am not currently working with. I'm not trying to delete
> the files from the repository, I just want free up space in idle
> repositories.
Well, that actually sounds like you might want to just make them totally
"bare" repositories, ie you can just do something like
mv repo/.git repo.git
rm -rf repo
and then "repo.git" is a valid bare repository.
However, if you actually want to just clear the checked-out files:
> After mothballing the repository with git-repack -a -d and git clean
> -d -x, is there a convenient one-liner to empty the files out the
> working directory?
Well, you can do
git ls-files -z | xargs -0 rm -f --
or something, or indeed just do a "rm -rf *", since the only thing you
actually would want to save is the ".git" directory.
Linus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Easy way to empty working tree?
2006-07-21 2:48 ` Linus Torvalds
@ 2006-07-21 7:08 ` Alex Riesen
0 siblings, 0 replies; 3+ messages in thread
From: Alex Riesen @ 2006-07-21 7:08 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Robin Luckey, git
On 7/21/06, Linus Torvalds <torvalds@osdl.org> wrote:
> > After mothballing the repository with git-repack -a -d and git clean
> > -d -x, is there a convenient one-liner to empty the files out the
> > working directory?
>
> Well, you can do
>
> git ls-files -z | xargs -0 rm -f --
>
That'd be not enough for kernel after it was compiled.
Maybe this:
find . -maxdepth 1 -not -name .git -not -name . -print0 | xargs -0 rm -rf --
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-07-21 7:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-21 1:28 Easy way to empty working tree? Robin Luckey
2006-07-21 2:48 ` Linus Torvalds
2006-07-21 7:08 ` Alex Riesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox