Tuesday, March 24, 2015

Git Deployment on Centos 6.6




First we need to make sure that we have installed required package on your system. Use following command to install required packages before compiling GIT source.

#yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
#yum install gcc perl-ExtUtils-MakeMaker

Download git source code from kernel git  or simply use following command to download GIT (latest version)
Steps :1

#cd /usr/src
# tar –xzf git-2.0.4.tar.gz

After Downloading and extracting GIT source code, Use following command to compile source code.

# cd git-2.0.4
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
# echo “export path=$path:/usr/local/git/bin” >> /etc/bashrc
# source /etc/bashrc
Once complete , You have successfully install GIT in your system , Let check the version using the following command

# git –version
git version 2.0.4

                 
 Certain GIT commands , such as git commit , required the user to write a short message or make some changes in an external text editor. To determine which text editor to start , GIT attempts to read the value of the GIT_EDITOR environment variable , the VIM .editor configuration option , the VISUAL environment variable, and finally the EDITOR environment variable in this particular order . if none of these options and variables are specified , the GIT command starts vim as a reasonable default option .

To change the value of the vim.editor configuration option in order to specify a different text editor, type the following as shell prompt:

# git config –global vim.editor command

Replace command with the command to be used to start selected text editor

Example 1

To Configure git to use vim as the default text editor , type the following at a shell  prompt:

#git config –global vim.editor vim


In GIT, each commit (or revision) is associated with the full name and email of the person responsible for it , GIT uses an identify based on the user name and host name .

To change the full name associated with the GIT commits, type the following at a shell prompt :
# git config –global user.name “full name”


To change the email address associated with your GIT commits type:

#git config –global user.email “email address”

Example 3:

To configure Git to use “Golden John” as your full name and goldenjohn@example.com as your email address, type the following at a shell prompt.


A repository is a place where GIT stores all files that are under revision control, as well as additional data related to these files, such as the complete history of changes or information about who made those changes and when . Unlike in Centralized revision control systems like Subversion or CVS , a GIT repository and a working directory are usually the same . A typical GIT repository also only stores a single project and when publicly accessible, it allows anyone to create its clone with a complete revision history .


To create a new empty GIT repository, change to the directory in which you want to keep the repository and type the following at a shell prompt

 Step 1

 Creating a new repository in the server
  A bare repository need to be created in the server and initialized
  Initialize a new bare repository in the server using the below command
 
      user$ git init --bare project_name.git    
 
  Sample Output: "Initialized empty Git repository in 'path to project'"
 
 


 Step :2

 Do a git clone of the new repository and you will be initialized with a new
 Repository.

    user$ git clone gitserver@192.168.xx.xx:<path to project>/<project_name.git>
    user$ cd project_name.git
   
Copy the files to be added to git

user$ git status
   











Sample Output : The output of the git status command after copying the files
            example.h
            example.c to the "project_name.git"
 
    The un-tracked files will be shown in RED
 
    “On branch master
   
    Initial commit
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
           
            example.h
            example.c
               
    Nothing added to commit but untracked files present (use "git add" to track)"
 
user$ git add .
user$ git commit –m “Initial Repository for windows8 Connection Manager
           







Listing your tags and creating the tag creation on below comments
User$ git tag -l

You need to go the repository path which is developers required repository  and enter and create the tag on below command,
User$ git tag –a v1.2 9fceb2

No comments:

Post a Comment