Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku Git Repository Size

Tags:

git

heroku

During late development of an application I've been git pushing to heroku such that the repository there is fairly large.

I would like at this stage, before site launch, to remove all old versions from the repo as it seems sensible housekeeping. What would be the best way to go about this so my online application be uninterrupted?

like image 799
mark Avatar asked Oct 07 '10 10:10

mark


People also ask

Is Git necessary for Heroku?

Also, just because Heroku uses Git doesn't mean you have to have a Github account (since you mention having to have a premium account). All Github provides is an additional place to store your code if you are working on it in a team. There is absolutely NO REASON that you have to use github to use Heroku.

Is Heroku integrated with Git?

Heroku integrates with GitHub to make it easy to deploy code living on GitHub to apps running on Heroku. When GitHub integration is configured for a Heroku app, Heroku can automatically build and release (if the build is successful) pushes to the specified GitHub repo.

How does Heroku work with Git?

The Heroku platform uses Git as the primary means for deploying applications (there are other ways to transport your source code to Heroku, including via an API). When you create an application on Heroku, it associates a new Git remote, typically named heroku , with the local Git repository for your application.


1 Answers

There is really no need to do this for Heroku specifically, as when you push, it compiles your app into a slug for quick deployment, and one step of that is dropping the git repo entirely.

But if you really want to do this, I'd suggest just deleting the .git/ directory from your project and starting a new repo with git init.

Heroku acts just like any other git remote you can push to, so anything you can do to a normal git remote, you can do to your Heroku git remote. So if you push a new, empty repo to it, that should solve your problem for sure.

like image 71
tfe Avatar answered Sep 22 '22 23:09

tfe