Joanne Chow
Joanne Chow

Reputation: 1048

Can Heroku work as version control?

I am working with this school project (webapp in RoR) in group of 10 and we get into this fight.

One says we should use Heroku as our web host because it does version control with git. The other says it's cool to use Heroku as web host, but it doesn't not store old code and keep track of changes, so we should set up our own github/assembla-git.

Who is right?

Upvotes: 2

Views: 847

Answers (2)

Daniel Brockman
Daniel Brockman

Reputation: 19290

There is nothing wrong with using Heroku as your main Git repository. I have dozens of projects that are set up this way.

Heroku is definitely not going to arbitrarily delete code or commits in your repository.

Of course, anything you push to the master branch will actually be deployed, but you are free to push other branches if you want (Heroku will simply ignore those).

The advantage of using GitHub in addition to Heroku is that you get a bunch of extra functionality on top of just the bare Git repository, such as a web-based UI and collaboration tools like pull requests, etc. Keep in mind that GitHub for private repositories is a paid service, however. There are also competitors to GitHub such as Bitbucket which offers private repositories for free for small teams.

But if you are already familiar with Git and don’t feel like you need any extra functionality on top of it, you might as well just go with Heroku. There’s something to be said for simplicity, as well.

Upvotes: 1

ck3g
ck3g

Reputation: 5929

Heroku uses git for deploy. So you can use it as version control too.

But I would not recommend it. When you push to heroku it's mean deploy to production. But your code can be not ready for it. Not tested yet, feature not fully implemented and etc.

You can add 2 remote for your repository.

git push origin master # github
git push heroku master 

So I would recommend you use heroku as webhost and github as version control

Upvotes: 5

Related Questions