Git Heroku 基本命令总结

1, Git

详细参考 http://help.github.com/linux-set-up-git/ 完成:

(1)Git 安装(一般安装了RoR,这Git早就安装好了);

(2)生成SSH;


Quick Guide 1:Creating and Commiting

$ cd (project-directory)

$ git init

$ (add some files)

$ git add .

$ git commit -m 'Initial commit'







Git 与 Heroku 结合: http://devcenter.heroku.com/articles/git

别人的总结参考:

http://guibin.iteye.com/blog/1014369

http://suiaing.wordpress.com/2010/07/11/git%E5%9F%BA%E6%9C%AC%E6%B5%81%E7%A8%8B/

Quick Guide 2:Cloning and Creating a Patch

$ git clone git://github.com/git/hello-world.git

$ cd hello-world

$ (edit files)

$ git add (files)

$ git commit -m 'Explain what I changed'

$ git format-patch origin/master









2. Heroku

安装heroku gem : $gem install heroku

详细参考: http://devcenter.heroku.com/articles/quickstart

(1) Track your application with Git

$cd PATH/TO/MY_APP
$git init
Initialized empty Git repository in .git/
$git add .
$git commit -m "commit new app"
Created initial commit 5df2d09: new app
44 files changed, 8393 insertions(+), 0 deletions(-)

(2) Set up your SSH keys, 参考1中的http://help.github.com/linux-set-up-git/
创建完SSH keys后,将其添加到heroku:
heroku keys:add 
(3) Create your Heroku application
$heroku create
Enter your Heroku credentials.
Email: joe@example.com
Password: 
Uploading ssh public key /Users/joe/.ssh/id_rsa.pub
Created http://high-sunrise-58.heroku.com/ | git@heroku.com:high-sunrise-58.git
Git remote heroku added
可以重命名 application, 进入RoR, application的目录, 运行: heroku rename new_name。 当然最简单的还是创建时命名:
heroku create app_name; 
(4) Push your application to Heroku
$git push heroku master

(5) Bootstrap your database
$heroku rake db:migrate

Next Steps

Now that your application is running, it’s easy to push updates:

   1. Develop and test changes locally.

   2. Commit code to git :$ git commit -a ("-a" represents committing all changed files). 

   3. Push your changes to Heroku with :$git push heroku

   4. Don't forget to migrate database when db change.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值