Skip to contentSkip to conversation

Safe way to remove .temp objects?

DISCUSSION Erik Mouw 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore

Erik Mouw

author
#0 lore raw

Hi,

After a git repack, git count-objects reports there are still 20 objects in the repository. It looks like those are temp objects:

erik@arthur:~/git/linux-2.6 > ls .git/objects/??/ .git/objects/14/:
d6545767f5103b5ef4702bc8fffa18dbe32ce1.temp

.git/objects/1a/:
d37b580be4215f1b0927b7560f5e8b8d1bc0fa.temp

[...]

Is there a git command to remove those objects in a safe way, or can I just rm them without "harming" git??

Erik

Signature · 3 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
| Data lost? Stay calm and contact Harddisk-recovery.com
#1 lore raw
Quoted 9 lines · Erik Mouw

Hi,

After a git repack, git count-objects reports there are still 20 objects in the repository. It looks like those are temp objects:

erik@arthur:~/git/linux-2.6 > ls .git/objects/??/ .git/objects/14/:
d6545767f5103b5ef4702bc8fffa18dbe32ce1.temp

Quoted 9 lines

.git/objects/1a/:
d37b580be4215f1b0927b7560f5e8b8d1bc0fa.temp

[...]

Is there a git command to remove those objects in a safe way, or can I just rm them without "harming" git??

	$ git prune-packed

When you repack, you can run

	$ git repack -d

to remove loose objects when you're done packing.

Signature · 3 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
#2 lore raw
Quoted 15 lines · Andreas Ericsson
Quoted 4 lines · Erik Mouw

Hi,
After a git repack, git count-objects reports there are still 20 objects in the repository. It looks like those are temp objects:
erik@arthur:~/git/linux-2.6 > ls .git/objects/??/

Quoted 9 lines

.git/objects/14/:
d6545767f5103b5ef4702bc8fffa18dbe32ce1.temp .git/objects/1a/:
d37b580be4215f1b0927b7560f5e8b8d1bc0fa.temp
[...]
Is there a git command to remove those objects in a safe way, or can I
just rm them without "harming" git??

Quoted 7 lines
	$ git prune-packed

When you repack, you can run

	$ git repack -d

to remove loose objects when you're done packing.

What is being asked is not about loose objects but droppings commit walkers make when interrupted.

I think *.temp files are garbage and you can safely remove them. They are not even correct objects.

author
#3 lore raw
Quoted 2 lines · Junio C Hamano

What is being asked is not about loose objects but droppings commit walkers make when interrupted.

That's indeed what I meant.

Quoted 2 lines

I think *.temp files are garbage and you can safely remove them. They are not even correct objects.

It looks like it was safe to remove, all git commands I tried just work.

Thanks,

Erik

Signature · 2 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands