Ruby On Rails Classroom image

Neha  Jaggi / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4 | 5|Last
Lessons:- Version Control with Git

Installation and Setup

The first step is to install Git if you haven’t yet followed the steps in Section 1.2.2. (As noted in that section, this involves following theinstructions in theInstalling Git section of Pro Git.)

First-time System Setup

After installing Git, you should perform a set of one-time setup steps. These are system setups, meaning you only have to do them once per computer:

$ git config --global user.name   "Your Name"
$ git config --global user.email your.email@example.com

also like to use co in place of the more verbose checkout command, which we can arrange as follows:

$ git config --global alias.co checkout

 

This tutorial will usually use the full checkout command, which works for systems that don’t have co configured, but in real life I nearly always use git co.

As a final setup step, you can optionally set the editor Git will use for commit messages. If you use a graphical editor such as Sublime Text, TextMate, gVim, or MacVim, you need to use a flag to make sure that the editor stays attached to the shell instead of detaching immediately:15

git config --global core.editor  "subl -w"

Replace "subl -w" with "mate -w" for TextMate, "gvim -f" for gVim, or "mvim -f" for MacVim

First-time Repository Setup

Now we come to some steps that are necessary each time you create a new repository. First, navigate to the root directory of the first app and initialize a new repository:

$ git init
Initialized  empty  Git  repository  in  /Users/mhartl/rails projects/first app/.git/

The next step is to add the project files to the repository. There’s a minor complication, though: By default Git tracks the changes of all the files, but there are some files we don’t want to track. For example, Rails creates log files to record the behavior of the application; these files change frequently, and we don’t want our version control system to have to update them constantly. Git has a simple mechanism to ignore such files: Simply include a file called .gitignore in the application root directory with some rules telling Git which files to ignore.16

 
 
 
image
Neha  Jaggi

Skills    Ruby On Rails

Qualifications :- High School - , College/University - Graphic Era Hill University, Dehradun, College/University - ,
Location :-Dehradun,Dehradun,UTTARAKHAND,India
Description:-

Experienced Software Developer with a demonstrated history of working in the Information Technology and services industry. Skilled in Web Technologies (Ruby on Rails, PostgreSQL, php, Laravel and AJAX). 


Explore
 

  Students (0)