开发者

Backing up work on a branch using heroku, rails and git

Rails/Heroku/Git newbie - here is my question. I have an app deployed with Heroku and am using the git repository hosted there as the only remote copy of my local work. I start making changes locally on a new branch and want to make this branch available on Heroku so that I c开发者_开发知识库an continue work on it from another computer. Heroku ignores branches other than master and I don't want to merge my changes yet (or push them as master). Is there a way to store/access my new branch via my Heroku git repository, or is it better to have another remote git repository for my work in progress.

Thanks!


You can push a local branch to the remote git server with:

git push origin branch_name

That way, you can pull it down again elsewhere with:

git checkout -b branch_name origin/branch_name

http://gitready.com/beginner/2009/02/02/push-and-delete-branches.html http://gitready.com/intermediate/2009/01/09/checkout-remote-tracked-branch.html


I would go with a separate git repository as suggested - github.com or similar. Store your code there and deploy to Heroku's master repo - Heroku is a hosting platform afterall not a home for your repos.

ALTERNATIVELY Make use of dropbox and create your local workspace in a dropbox folder that is synced across multiple computers - I employ this method as well as git - plus you get the advantage that Dropbox is versioned so if you delete/change a file that you haven't committed yet you can get it back.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜