Show contents of all git objects in a git repo

find .git/objects/ -type f \| sed 's/\.git\/objects\/\///' | sed 's/\///g' | xargs -n1 -I% echo echo "%" \$\(git cat-file -p "%"\) \0 | xargs -n1 -0 sh -c
This script finds all git objects and `git cat-file`'s their content. This is really just a helper function to play around with the internals of git repositories. See https://git-scm.com/book/en/v2/Git-Internals-Git-Objects of more info.
Sample Output
$ mkdir test1; cd test1; git init
$ echo hello | git hash-object --stdin -w
ce013625030ba8dba906f756967f9e9ca394464a

$ cd ..; git clone test1 test2; cd test2

# now we run the command and notice
# the objects have been cloned
$ find .git/objects/ -type f \| sed 's/\.git\/objects\/\///' | sed 's/\///g' | xargs -n1 -I% echo echo "%" \$\(git cat-file -p "%"\) \0 | xargs -n1 -0 sh -c
4b825dc642cb6eb9a060e54bf8d69288fbee4904
ce013625030ba8dba906f756967f9e9ca394464a hello

1
By: wires
2020-11-15 09:24:58

What Others Think

Just use the pipe char in §sed§ under most circumstances instead of forward slash cuz you most likely need to escape more forward slashes than pipes. Plus it makes it much more readable and coherent.
rautamiekka · 14 weeks and 6 days ago
Do you sometimes have trouble writing an essay, or is it just that inspiration leaves you and you still need to write? I offer assignment help and you will see that this is the best service.
Otharei · 14 weeks and 5 days ago
I am the cofounder at CIPD writer Jordan and I am looking for a complete guide for coding, I want to learn how to develop a website in a professional way for my business and coming up ventures that I am planning. I need help, is there any expert? Or a teacher who can guide me thoroughly.
alicemorgan · 14 weeks and 3 days ago
Really, this article is to a great degree one of the most flawlessly awesome ever [url=https://free-cell.co/]freecell[/url]
Selenagobella · 14 weeks and 1 day ago
it doesn't work. are there any other script? fencingsacramentoca.com
looneyhans · 13 weeks and 5 days ago
nice it really works! bathroomremodelcedarrapids.com
Killersmile · 13 weeks and 2 days ago
Thanks for sharing this information with us, I really admire such platforms that offer valuable information that is not available anywhere else. I am a blogger employed at guardians of the galaxy shop, offering writing services at affordable rates, if you want us to write your web content comment below.
alicemorgan · 12 weeks and 6 days ago
Your article has aroused a lot of positive attention. Thank you for sharing. renodrywallrepair.com
keywave110 · 12 weeks and 2 days ago
Osmanthus fragrans tea is a kind of precious flower tea made from exquisite tea billet and fresh osmanthus https://www.newblogclub.com
rong090 · 11 weeks and 2 days ago
Osmanthus fragrans tea is a kind of precious flower tea made from exquisite tea billet and fresh osmanthus new york escorts near me
rong090 · 11 weeks and 2 days ago
voip phone system service provider Osmanthus fragrans tea is a kind of precious flower tea made from exquisite tea billet and fresh osmanthus
rong090 · 11 weeks and 2 days ago
great bathroom remodeling contractors
looneyhans · 10 weeks and 5 days ago
awesome site thanks for posting fence company spartanburg
looneyhans · 10 weeks and 4 days ago
It’s also a place that, in a thousand years, might provide archaeologists with the most accurate clues as to what 21st century society was like. Inside an abandoned mine with an underground vault, a unique, Preet 8049 4WD Price
hrihant · 9 weeks and 4 days ago
I like robots. I know one company https://aduk.de/ . They working hardware and software.
val11 · 9 weeks and 3 days ago
Awesome blog by the way and thanks for sharing! septic tank pumping
idasanka · 9 weeks and 2 days ago
I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites blog site list and will be checking back soon. Please check out my site as well and let me know what you think. click" rel="nofollow">http://libjournal.uncg.edu/ap/user/viewPublicProfile/5446'>click this site
bojokey283 · 8 weeks and 6 days ago
Have you guys always wanted to be taught something before you did something and made a bunch of mistakes? Learning from your mistakes is good, but sometimes these mistakes can be fatal, so it is advisable to know about them and avoid them in advance. It is the same with bets, we need money and we cannot lose it! Because it's great that there are articles like this one https://www.mappingmegan.com/worldwide-sporting-events-post-pandemic/where people tell you how to avoid mistakes when betting
Laibor · 8 weeks and 6 days ago
Have you guys always wanted to be taught something before you did something and made a bunch of mistakes? Learning from your mistakes is good, but sometimes these mistakes can be fatal, so it is advisable to know about them and avoid them in advance. It is the same with bets, we need money and we cannot lose it! Because it's great that there are articles like this one https://www.mappingmegan.com/worldwide-sporting-events-post-pandemic/where people tell you how to avoid mistakes when betting
Laibor · 8 weeks and 6 days ago
Your work is very good and I appreciate you and hopping for some more informative posts. Thank you for sharing great information to us. read more http://libjournal.uncg.edu/ap/user/viewPublicProfile/5446
xoheko1229 · 8 weeks and 4 days ago
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. forex
bojokey283 · 7 weeks and 4 days ago
home health care las vegas I was just wondering... I'm an android user now but I want to change it to that. How can I get started?
yeoyeo · 7 weeks and 3 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. covid isla mujeres
bojokey283 · 7 weeks and 2 days ago
Nursing coursework writing service seekers have been on the rise lately since most learners need Legitimate Nursing Writing Services, legitimate nursing writing services and professional nursing essay writing help services.
joandavis · 6 weeks and 6 days ago
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. online marketing
bojokey283 · 6 weeks and 4 days ago
Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. house clearance bridgend
bojokey283 · 6 weeks and 4 days ago
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. taco catering
bojokey283 · 6 weeks and 3 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. buy targeted traffic
bojokey283 · 6 weeks ago
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me. Turmeric Essential Oil
bojokey283 · 5 weeks and 5 days ago
This works really well for us, thank you! Thanks for the information, keep sharing this type of info Krogerfeedback
Greenfelder · 4 weeks and 5 days ago
Thank you people
sammm · 4 weeks and 2 days ago
You have a real ability for writing unique content. I like how you think and the way you represent your views in this article. I agree with your way of thinking. Thank you for sharing. tulum mexico weather
bojokey283 · 3 weeks and 6 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. schluesseldienst köln
bojokey283 · 3 weeks and 4 days ago
Anybody here tried to sell osrs gold before?
charlesmax23 · 2 weeks and 2 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. cancun
bojokey283 · 2 weeks ago
I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. okos ügyvéd Debrecen
bojokey283 · 1 week and 3 days ago
Only aspire to mention ones content can be as incredible. This clarity with your post is superb and that i may think you’re a guru for this issue. High-quality along with your concur permit me to to seize your current give to keep modified by using approaching blog post. Thanks a lot hundreds of along with you should go on the pleasurable get the job done. cenotes en tulum mexico
xoheko1229 · 6 days ago
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me. otomatisasi rumah
bojokey283 · 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: