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

0
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 · 6 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 · 6 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 · 6 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 · 6 weeks and 1 day ago
it doesn't work. are there any other script? fencingsacramentoca.com
looneyhans · 5 weeks and 5 days ago
nice it really works! bathroomremodelcedarrapids.com
Killersmile · 5 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 · 4 weeks and 6 days ago
Your article has aroused a lot of positive attention. Thank you for sharing. renodrywallrepair.com
keywave110 · 4 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 · 3 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 · 3 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 · 3 weeks and 2 days ago
great bathroom remodeling contractors
looneyhans · 2 weeks and 5 days ago
awesome site thanks for posting fence company spartanburg
looneyhans · 2 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 · 1 week and 4 days ago
I like robots. I know one company https://aduk.de/ . They working hardware and software.
val11 · 1 week and 3 days ago
Awesome blog by the way and thanks for sharing! septic tank pumping
idasanka · 1 week 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 this site
bojokey283 · 1 week 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 · 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 · 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 · 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:

日本中文av无线观看_日本中文字幕在线视频二区_日本综合久久av观看