| Subversion | Git | |
---|
Prerequisites | Subversion Server | Git Server | |
| Find the Subversion server documentation from http://svnbook.red-bean.com/en/1.5/ | The complete Git server documentation can be found from https://git-scm.com/documentation | |
| Subversion Repository Find the documentation „how to install a subversion server“ from http://svnbook.red-bean.com/en/1.8/svn.serverconfig.html | Git Repository You can create a central repository by: - navigating to a
live sub-folder where the Git repository should be located, e.g. c:\temp\git_repro\live . - executing the command:
| |
| Subversion Client | Git Client | |
| Install the Subversion Client on the computer where JobScheduler is located | Install the Git Client on the computer where JobScheduler is located | |
| Subversion Working Copy | Git Working Copy | |
| Create a working copy in your live folder from the repository. | Create a working copy in your live folder from the Git repository with the following commands: | |
| svn import -m "initial load" --username myUser --password myPassword "C:\sos-berlin.com\jobscheduler\scheduler_current\config\live" http://subversion.sos/svn/myprocject
Please note that after the import the live folder is not a working copy. | - navigate to your
live folder - move all files to a temporary folder
git clone c:\temp\git_repro\live
- move all files back to the
live folder and execute:git add * git commit -m "initial load " git push origin master
| |
| The files are now in the Subversion repository. You can verify this with the command: svn list http://subversion.sos/svn/myproject
| The files are now in the Git repository. You can verify this by cloning the repository to another folder: git clone c:\temp\git_repro\live
| |
| Delete the files from the live folder. Execute the command checkout to get the files from the repository to the live folder: svn checkout http://subversion.sos/svn/myprocject
"C:\sos-berlin.com\jobscheduler\scheduler_current\config\live"
| | |
Creating Working Copies | You can have several working copies of the live folder (see command checkout ). The following commands are available to synchronize changes to the working copy with the repository: | You can have several working copies of the live folder (see command clone ). The following commands are available to synchronize changes to the working copy with the project folder: | |
| Read the current version from the repository (update ). The update command reads changes from the repository and merges them into the working copy: svn update C:\ jobscheduler\scheduler_current\config\live
| Read the current version from the repository (pull ): git pull c:\temp\git_repro\live
| |
| The commit command writes changes from the working copy to the repository. Please note that before committing changes an update command is recommended: svn commit C:\ jobscheduler\scheduler_current\config\live
| The push command writes committed changes from the working copy to the repository: git commit -m "Commit-Message"
git push origin master
| |
Making Changes | Changes are applied to the working copy by use of JOE or a text editor. With all changes for a certain feature being developed the changes can be committed to the repository. Before carrying out the commit command the working copy has to be updated with changes from other working copies by executing the update command. During the update it is possible that a conflict will be detected. That means that a change has been made in your working copy and also in another working copy to the same file and the same line of code. In this situation you have to resolve the conflict before proceeding. It is neccessary to use a commit message with the commit command. - update
- make changes
- update
- commit
| Changes are applied to the working copy by use of JOE or a text editor. - pull
- make changes
- pull
- commit
- push
| Deployment |
Deploying Objects | There are two possible architectures to organize the deployment: The live folders of integration and production environments also are working copies The live folders of the integration and production environments are simple folders without assignment to a repository
When integration and production environments are working copies, then the deployment will be done by executing an update command on the integration/production live folder. Changes can be done directly in the integration/production live folders. They will be merged with the changes coming from the development environment. This approach is more risky as the merged changes are not tested. The configuration will be merged directly to the integration/production live folder and has never existed in this version before. For a more save and stable environment, it should avoided to make changes directly in integration/production environment live folders.
When integration and production environments are simple folders, then the deployment will be done by executing the export command from the development environment to the integration/production environments. Before doing the export, existing files should be deleted. del /s c:\int\live
svn export http://subversion.sos/svn/myprocject/live C:\int\live
svn export http://subversion.sos/svn/myprocject/include/int C:\int\live
Changes that have been made directly to the integration/production folders will be overwritten In case of an urgent, quick change directly in the integration/production environment, the change also has to be applied to the development environment to make it persistent. Working with this approach is more safe as In integration/production environments normally no changes will be applied. The configuration that is deployed has been tested in the development environment.
| | |
| | | |