Remove .git directories from "gems" installed from git sources #76

danp opened this Issue Mar 21, 2013 · 9 comments


None yet

5 participants

danp commented Mar 21, 2013

ref #16

If I have:

gem "rails", :git => "git://", :ref => "3-0-stable"

In my Gemfile I end up with a directory like:


in my slug. This directory contains a .git directory. In a slug created from an app with the above line in its Gemfile that .git directory is 64M. I believe this directory can be removed from the slug and things will still work.

@danp danp added a commit to danp/heroku-buildpack-ruby-minimal that referenced this issue Mar 21, 2013
@danp danp Remove .git directories from git-sourced gems. Ref heroku/heroku-buil… 6c0df97
danp commented Dec 10, 2013

As a datapoint for this issue, my buildpack has been used with the linked commit for some time without issues seen or reported.


Seems good to me. Do you have any idea how long the .git/ folder removal takes?

danp commented Dec 12, 2013

Near-none in my experience, though I have not measured specifically. I just pushed an app using rails from git and my buildpack and there was no noticeable delay between installing the bundle and "Discovering process types", during which the deletion would have taken place.


We should probably do this

danp commented Feb 27, 2015

👍 I still think this should be safe.

Pinging @schneems. Any news on this?


cyx commented Apr 23, 2015

👍 Willing to take a stab on this if we're all good with the idea.

schneems commented May 5, 2015

This is deployed

@schneems schneems closed this May 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment