After Rails is installed:
> rails server
> rails new blog
> cd blog
> rails generate scaffold post title:string body:text
> rails generate scaffold comment post_id:integer body:text
> rake db:migrate
> rake routes
localhost:3000/posts#index
--------------------------------------------------
GIT commands:
Create new local rep.
> git init
Connecting it to remote repository
> git remote add origin <http-link-remote-rep> ***
Config. username & email
> git config --global user.name "Boomblebee"
> git config --global user.email "mail2...@gmail.com"
Pushing for the first time
> git push origin master
Working dir -> staging area
> add .
Staging area -> local GIT rep.
> commit -m "My message!"
Working dir -> local GIT rep.
> commit -a
Local GIT rep. -> working dir.
> checkout <branch>
> merge <branch>
Check synchronize & the branch you are in
> git status
Local GIT rep -> Remote GIT rep
> push <remote> <branch>
Remote GIT rep -> Local GIT rep
> fetch
Remote GIT rep. -> Working dir.
> pull <remote> or clone <remote>
_____________
*** github.com ; bitbucket.org
> rails server
> rails new blog
> cd blog
> rails generate scaffold post title:string body:text
> rails generate scaffold comment post_id:integer body:text
> rake db:migrate
> rake routes
localhost:3000/posts#index
--------------------------------------------------
GIT commands:
Create new local rep.
> git init
Connecting it to remote repository
> git remote add origin <http-link-remote-rep> ***
Config. username & email
> git config --global user.name "Boomblebee"
> git config --global user.email "mail2...@gmail.com"
Pushing for the first time
> git push origin master
Working dir -> staging area
> add .
Staging area -> local GIT rep.
> commit -m "My message!"
Working dir -> local GIT rep.
> commit -a
Local GIT rep. -> working dir.
> checkout <branch>
> merge <branch>
Check synchronize & the branch you are in
> git status
Local GIT rep -> Remote GIT rep
> push <remote> <branch>
Remote GIT rep -> Local GIT rep
> fetch
Remote GIT rep. -> Working dir.
> pull <remote> or clone <remote>
_____________
*** github.com ; bitbucket.org
Niciun comentariu:
Trimiteți un comentariu