gitdump: give people access to your code ;-)

Search for a command to run...

No comments yet. Be the first to comment.
Riding the Coin Pusher of Life

How to Write Tasks for Humans and Machines

The pursuit of Artificial General Intelligence (AGI) — a concept I learned about this week — is often framed as a climb toward a distant mountain peak. We define it broadly, as an AI that matches or exceeds the sum total of human capability—the abili...

Turn Your Git Repository into an SQL Database with gitstatdb

Hacktoberfest 2025 just finished — and guess what? They brought back the swag!After last year’s digital-only celebration, seeing the return of t-shirts and tree-planting rewards brought a wave of nostalgia and motivation 😊 For some reason, I didn’t ...

devpassion Tech Insights, Open Source & Personal Growth
26 posts
I wear many hats in my professional life - developer, system administrator, and even a teacher at times. You could say I have a mixed bag of skills and experiences, both good and bad. One thing I absolutely love is writing, so you'll find some of my content floating around the web, along with a ton of code.
I just learned about these tools today... yeap, that should have happened sooner!
Turns out that there is a set of tools out there that can connect to an online .git directory and download the whole history and code from there. So, if you are like me and do all your code installs using git in order to:
then you are putting online, available by accessing your site, the .git directory for each install you do.
The gitdumper tools can read the .git directory and download all the objects that are there to a local computer. With that, the person who downloaded the repository can recover the code and all the history of the development of that install. Useful!
I decided to give it a try on one of our many coreBOS installs and immediately received a 403 error. I connected to the server and saw that our company procedures configure our web server with a set of default files and directories that are not accessible. The .git directory is one of them. That was nice :-) !!
I reconfigured the web server to permit access to the directory and tried again. That looked rather lacking:


As you can see, luckily, it failed to download more files than it managed to get correctly. I tried with two different tools and the results were similar. That said, they both downloaded enough information to retrieve directory structure, some code, and a lot of commit history.
Then, after restoring the access restriction on the server (in case you were wondering), I tried the tools against my localhost development install. Here the results were significantly different being able to download most of the files correctly. Scary if you consider that both tools I tried are marked as educational. Imagine what the real ones can do!
Finally, I share with you the configuration setting we have in our /etc/apache2/conf-enabled directory. Among other entries we have this one that did the magic for this case:
RedirectMatch 403 /\.(svn|git|hg|env)(/|$)
The two tools I tried:
HTH
Joe
Photo by Kyle Glenn on Unsplash