Git

Rails Details Snippets Rails hosting PuTTy

Git – distributed version control system: (a) track project’s code changes, (b) easier collaboration, (c) roll back in case of error.

RepositoriesGitHub , Bitbucket

Configuration: one time per user:
$ git config
Create your Bitbucket free account – Bitbucket signup.
Create your GitHub free account – GitHub signup

Snippets:
$ git init   # initialize a new repository
$ git add -A # add all the project files to the repository
$ git commit -m "project_phase_name" # keep the changes; -m flag for message
$ git commit -a -m "project_phase_name" # add and keep the changes of existing files
$ git checkout -b 'project_step_name' # create and switch to a new step branch
$ git checkout master # switch to a branch 'master'
$ git remote add origin git@bitbucket.org:/project_name.git # origin
$ git remote add origin git@github.com:/project_name.git # origin

Create on remote repository (Bitbucket or GitHub) the new project_name repository.
$ git push -u origin --all   # push local repository content up to the remote origin repository
$ git merge Project_step_name   # merge step branch in the master branch
$ git -d Project_step_name   # delete step branch
$ rm -rf path/FileName   # delete file FileName
$ git checkout -f   # overwriting the current changes
$ heroku login
$ heroku create project_name
$ git push heroku master

Help:
$ git help
$ git help -a   # available Git Commands
$ git help status   # status of the working tree
$ git help branch   # list, create, or delete branches
$ git help -g   # common Git guides
$ git help glossary   # Git Glossary

Rails Details Snippets Rails hosting PuTTy