Using the git software management system

Git is the software management system BCO-DMO is using to manage many of the software packages we have developed to implement the BCO-DMO data management system. The following is the basic information for extracting a master software package from the git repository to a local location, edit the software and then update the git repository. As a specific example, these notes focus on the Perl library file, BCO-DB.pm.
 
Step 1A only needs to be done once since it initially creates the local subdirectory at which the software will be stored. Step 1B is done each time you want to get the most up to date version of the software to work on.
 
In summary, after the initial creation of the local git repository, the commands are: ‘git pull’ first, followed by editing, ‘git status’ to recognize the changed files, ‘git add’ for changed file you wish to commit, ‘git commit’, and ‘git push’
 
1. A. On your local machine, change directory to location you want to create the subdirectory of the software on which you want to work. In this case, they are the perlmodules. To get the software to work on use the ‘git clone’ command:
 
               (../metadata_db/perlmodule.git)
 
Note that a subdirectory will be created called the same name as the .git file name, so in this case, a directory is created (if necessary) in the location you are in, called permodule.
 
1. B. On your local machine, change directory to the subdirectory created during step 1A, above. In this case it will be /home/<yourname>/update_software/perlmodule. Then issue the command to bring over the most recent version of the software:
 
                              git pull
 
To fetch the files from the remote repository and merge them with the local ones. This command is equal to the git fetch and the git merge sequence. In this case, and at this time, two Perl modules are brought over, the version for the legacy metadata database and the version for the Drupal version of the database.
 
2.      The next step is to edit the file(s) you need to edit.

 

3.      To see what files have been changed:
 
                           git status
 
4.      To add your local changed file(s) to the local git database:
              
               git add BCO_DB.pm:
 
5.      To commit the changes to the local database:
 
               git commit –m “detailed message”
 
6.      This command pushes your changes to the Bare repository making your version the official version:
 
               git push
 
The production location for the Perl metadata library is at

    /data1/Software/libraries/metadata_db/perlmodule

One must issue the git pull command once at this location in order to bring over the production version of the software from the git Bare repository. For historical reasons, the Perl library was located at  

    /data1/www/bco-dmo/perlmodule/BCO_DB.pm

so this became a soft link to the new location. That is, use the following command:

 
               ln  –s    /data1/www/bco-dmo/OSPREY-Perl-module/drupal/BCO_DB_Drupal.pm     BCO_DB.pm
 
The symbolic link does not need to be repeated. Updating the software at the production location will ensure that the correct, and most up to date version of the software will be used.