About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:recommended_tools:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:recommended_tools:git [2018/07/24 12:05] – [Deploying on Multiple Servers] demiankatzdevelopment:recommended_tools:git [2022/12/14 18:39] (current) – [Getting Started] demiankatz
Line 1: Line 1:
 ====== Git ====== ====== Git ======
  
-Git is a distributed version control system.  It is used for development of VuFind 2.x+, replacing [[legacy:vufind_1.x_developer_manual:subversion|Subversion]], which was used for maintaining the 1.x code.+Git is a distributed version control system.  It has been used for the development of VuFind® since version 2.0.
  
 ===== Cloning the Repository ===== ===== Cloning the Repository =====
  
-To get a copy of the latest VuFind code in Git, you can issue this command:+To get a copy of the latest VuFind® code in Git, you can issue this command:
  
 <code> <code>
Line 17: Line 17:
 </code> </code>
  
-===== Managing a VuFind Installation Using Git =====+===== Managing a VuFind® Installation Using Git =====
  
-Git can be a useful tool for managing and deploying your local custom installation of VuFind. This section describes one possible approach. It assumes some familiarity with Git; see below for resources to help you learn more.+Git can be a useful tool for managing and deploying your local custom installation of VuFind®. This section describes one possible approach. It assumes some familiarity with Git; see below for resources to help you learn more.
  
 ==== Getting Started ==== ==== Getting Started ====
  
-1.) Create a fork of the main VuFind repository. If you plan on tracking your configuration files in Git, be sure that this is private -- you can either use a private GitHub repository or host your own Git repository on a local server.+1.) Create a fork of the main VuFind® repository. If you plan on tracking your configuration files in Git, be sure that this is private -- you can either use a private GitHub repository or host your own Git repository on a local server.
  
-2.) On your server, clone the fork and check out the appropriate branch or tag for your needs. If you want to stay up to date with bleeding-edge development, use master. If you want to stick to an officially-released version, use a tag like v4.1.3 or v5.0.+2.) On your server, clone the fork and check out the appropriate branch or tag for your needs. If you want to stay up to date with bleeding-edge development, use dev. If you want to stick to an officially-released version, use a tag like v4.1.3 or v5.0.
  
 3.) From the checked-out branch or tag, create a new branch for your local work on the server (for example, you might create a development branch for your development server, a staging branch for your staging server, and a production branch on your production server). 3.) From the checked-out branch or tag, create a new branch for your local work on the server (for example, you might create a development branch for your development server, a staging branch for your staging server, and a production branch on your production server).
  
-4.) Set up and configure VuFind (you can follow the usual [[:installation|Installation]] documentation, just use your Git checkout in place of a downloaded .tar.gz file).+4.) Set up [[development:recommended_tools:composer|Composer]] and run "composer install" to load VuFind®'s dependencies.
  
-5.) Commit your local custom code and configurationthen push everything up to your fork.+5.) Set up and configure VuFind® (you can follow the usual [[:installation|Installation]] documentationjust use your Git checkout in place of a downloaded .tar.gz file).
  
 +6.) Commit your local custom code and configuration, then push everything up to your fork.
 +
 +:!: Note that, starting with release 9.0, VuFind® includes rules in its .gitignore file that will prevent you from committing certain files from your local/config/vufind directory. This is a safety feature to prevent people from accidentally sharing local content in public. When you actually intend to commit these files to a private repository, you can override this by putting an additional .gitignore file inside local/config/vufind to reverse the instructions:
 +
 +<code>
 +!*.ini
 +!*.json
 +!*.yaml
 +</code>
 ==== Deploying on Multiple Servers ==== ==== Deploying on Multiple Servers ====
  
-As suggested in step 3 above, if you have a development --> staging --> production cycle, it is useful to create a separate branch for each server where you are deploying VuFind. This way, you can use simple Git merges to move changes through the cycle.+As suggested in step 3 above, if you have a development --> staging --> production cycle, it is useful to create a separate branch for each server where you are deploying VuFind®. This way, you can use simple Git merges to move changes through the cycle.
  
 === Establishing and Updating a New Server Branch === === Establishing and Updating a New Server Branch ===
Line 55: Line 64:
 ==== Upgrading ==== ==== Upgrading ====
  
-You will periodically want to update your fork with upstream changes -- for example, when a new feature you need is added to the master branch, or when a new official release is issued.+You will periodically want to update your fork with upstream changes -- for example, when a new feature you need is added to the dev branch, or when a new official release is issued.
  
-For example, suppose that you established a "development" branch based on the v4.1 tag, and you wish to upgrade to VuFind 5.0. You could follow these steps:+For example, suppose that you established a "development" branch based on the v4.1 tag, and you wish to upgrade to VuFind® 5.0. You could follow these steps:
  
-1.) Set up a remote named "upstream" if you do not already have one, pointing at the [[https://github.com/vufind-org/vufind|main VuFind Git repository]].+1.) Set up a remote named "upstream" if you do not already have one, pointing at the [[https://github.com/vufind-org/vufind|main VuFind® Git repository]].
  
 2.) Perform a "git fetch upstream" to get the upstream changes and new tags. 2.) Perform a "git fetch upstream" to get the upstream changes and new tags.
Line 65: Line 74:
 3.) Perform a "git merge v5.0" to bring in the release 5.0 changes. 3.) Perform a "git merge v5.0" to bring in the release 5.0 changes.
  
-4.) Update your local configurations and customizations as described in the [[installation:migration_notes|migration notes]]. As noted there, always check the [[:changelog|changelog]] for possible breaking changes. You may be able to automate some of the local updates (configurations and templates) by using the technique described in [[http://blog.library.villanova.edu/libtech/2015/07/23/automatically-updating-locally-customized-files-with-git/|this article]].+4.) Run "composer install" to update dependencies as needed. 
 + 
 +5.) Update your local configurations and customizations as described in the [[installation:migration_notes|migration notes]]. As noted there, always check the [[:changelog|changelog]] for possible breaking changes. You may be able to automate some of the local updates (configurations and templates) by using the technique described in [[http://blog.library.villanova.edu/libtech/2015/07/23/automatically-updating-locally-customized-files-with-git/|this article]]
 + 
 +:!: The [[videos:upgrading_vufind_using_git|Upgrading VuFind® Using Git]] video demonstrates a procedure similar to the one described here.
 ===== Learning More ===== ===== Learning More =====
  
Line 73: Line 86:
  
   * [[http://blog.library.villanova.edu/libtech/2015/07/23/automatically-updating-locally-customized-files-with-git/|Automatically updating locally customized files with Git and diff3]] - An article on using Git to update locally customized configuration and theme files.   * [[http://blog.library.villanova.edu/libtech/2015/07/23/automatically-updating-locally-customized-files-with-git/|Automatically updating locally customized files with Git and diff3]] - An article on using Git to update locally customized configuration and theme files.
-  * [[development:git-branches|Useful Git Branches]] - Branches in the VuFind repository that may offer useful features beyond the core distribution.+  * [[development:git-branches|Useful Git Branches]] - Branches in the VuFind® repository that may offer useful features beyond the core distribution.
 ---- struct data ---- ---- struct data ----
 +properties.Page Owner : 
 ---- ----
  
development/recommended_tools/git.1532433908.txt.gz · Last modified: 2018/07/24 12:05 by demiankatz