Roshan Book

My Tech Notebook

Starting with rails development


Installing

1. Install from http://railsinstaller.org/

2. Walkthrough

RailsInstaller 1.1.1 Demo from Engine Yard on Vimeo.

3. It will install all rails dependencies, gothub account, keys etc

4. Add the public key to your github account

Starting with rails

1. Create project : rails new appName

2. Starting the built in server – rails s

3. In cmd inside your project directory load .gitignore file by running

a) notepad .gitignore

b) A file having list of directories to be ignored is loaded up.

c) Delete all the entries and enter new entries from https://gist.github.com/732294 . They are

.bundle

db/*.sqlite3*

log/*.log

*.log

tmp/**/*

tmp/*

Gemfile.lock

doc/api

doc/app

*.swp

*~

.DS_Store

Starting git repository .  Visit http://www.blog.roshanbook.com/category/hacker/ for commands reference

Inside you app

1. git init

2. git add .

3. git status

4. git commit –m “comment”

5. git log

Untill now all the changes are inside local directory. To push into your git profile follow the following steps

6. git config –global user.name “manish roshan”

7. git config –global user.email manishroshan@gmail.com

8. git remote add origin git@github.com:manishroshan/test_app.git

9. git push origin master

This will publish your repository to github

Working on Branch

1. creating a branch – git checkout –b branchname

2. restore – git checkout –f

3. another way to restore – git reset –hardHEAD

4. commit all changes inside branch git commit –am “comment”

Restoring back to master file

5. Going as master- git checkout master

6. Getting branch list – git branch

7. Delete branch – git branch –D branchname

Starting a branch and merging with master

8. git checkout –b branchname

9. git mv oldfilename newfilename

10. git commit –am “comment”

11. git checkout master

12. Merging master and branch – git merge

13. check to see if everything is updated and nothing to commit-git status

14. git push

Deploying

1. Create login account at http://www.heroku.com/

2. In your cmd run : gem install heroku

3. add public key – heroku keys:add

4. create  a project on heroku – heroku create

5. from inside your app git push heroku master

6. To rename your app : heroku rename appname

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: