Versioning of server project content
This section describes the most basic use cases of versioning server projects with two popular version control systems. It describes the way to use the particular version system and Data Shaper Designer together. It does not serve to replace the documentation of any particular version control system.
We encourage you to read the documentation for version control system tool of your choice as well.
- Initial Check-Out of Project from Repository
- Adding Server Project to Version Control
- Connecting Server Project to Existing Repository
- Getting Changes from Repository
- Committing into Repository
Server projects store files remotely and locally. This allows you to use version control system of your choice. You can use an Eclipse plugin as well as an external tool. The basic workflow of usage of Git and SVN versioning systems in Data Shaper Designer is described below.
Version Control System Files and Synchronization
Version control system metadata files (e.g .svn directory) must not be synchronized between Designer and Server. These files avoided from synchronization are listed in Preferences under Ignored Files section. If you use Bazaar, Git, Mercurial, or SVN, you do not have to care about this, as it is already configured. If you use any other version control system, you should add its files and directories to this list of ignored files.
Versioning Tools
The following text describes the basic work flows with Git and SVN. For both, an approach with an Eclipse plugin (EGit, Subclipse), external GUI tool (TortoiseGit, TortoiseSVN) and command line utilities is described.
EGit is an Eclipse plugin for versioning with Git. It is included in Data Shaper Designer.
Subclipse is an Eclipse plugin for versioning with SVN. Since it is not part of Data Shaper Designer, you need to install it, e.g from Eclipse Marketplace.
TortoiseGit and TortoiseSVN are external GUI tools.
Initial Check-Out of Project from Repository
There is an existing project in the repository. Your task is to create a new server project with content from the repository.
GIT
To version files with Git, you can use Eclipse plugin (EGit), external GUI or command line tool.
Eclipse Plugin - EGit
-
Clone the remote Git repository:
Switch to Git perspective.
In the Git Repositories tab, click Clone a Git Repository and add the clone to this view.
Enter the remote repository location and password.
Choose branches to be tracked.
Enter the path for the local repository.
Switch back to Data Shaper perspective. -
Import the project.
From the File menu, choose Import.
Choose Git > Projects from Git and click Next.
Choose Existing local repository.
Choose the repository.
Select the Import existing projects option.
Select projects that should be imported. -
Convert the project to Server Project.
Right click the project in Project Explorer and choose Convert to server project.
Enter Data Shaper Server URL, User name and Password.
Select Create new sandbox. Enter the sandbox Name.
Select type of merge. As you created a new sandbox, you can use the Use local content only (sandbox will be cleaned) option.
You have a new server project. The project has content of a master branch of local repository.
EGit allows you to have more projects within the save repository.
External GUI Tool - TortoiseGit
-
Clone the remote repository.
In File Explorer, right click and choose Git Clone.
In Git clone - TortoiseGit dialog, enter the path to remote repository and the path to local repository.
Click OK.
Enter password.
Close the cloning log window. -
Import the project.
-
Convert project to Server Project.
External Command Line Tool
-
Clone the git repository
Type the command
git clone path_to_remote path_to_local
e. g.
git clone ssh://
-
Import the project.
-
Convert project to Server Project.
SVN
Eclipse Plugin - Subclipse
-
Import project from SVN.
Choose File > Import.
Choose SVN > Checkout Projects from SVN.
In Select/Create Location step of the wizard, choose Create new repository location.
Specify location of SVN repository. The URL for remote projects can be, e.g.https://svn.example.org/svn
. The URL for local projects can be, e.g.file:///Users/clover/repositories/svn/repo1
.
Select the folder (project) to be imported.
In Check Out As step, choose Check out as a project in the workspace and change ProjectName if necessary.
Optionally, change the location to which the project will be checked or add the project to working sets. -
Convert the project to Server Project.
External GUI Tools - TortoiseSVN
You can use an external graphical tool to check out an svn project. The following steps describe checking out of an existing project with help of TortoiseSVN.
-
Check-out the content of projects from SVN:
Right click the project directory in File Explorer and choose SVN Checkout… from context menu.
Delete the last entry from the Checkout directory text field. Click OK.
TortoiseSVN complains that the directory is not empty. Choose Yes. -
Import the project.
-
Convert the project to Server Project.
Command Line Tools
-
Check out the project from svn:
Move to the directory with the Project in workspace (on the computer with Designer).
Typesvn checkout --force /path/to/repository
. The--force
forcessvn
to overwrite the content created during the project creation. Otherwise, you would have to resolve conflicts after checkout. -
Import the project.
-
Convert the project to Server Project.
Adding Server Project to Version Control
This section describes a way to create a brand new versioned server project and to commit it to a new remote repository. It describes the way to add an existing unversioned server project to the repository as well.
Generally, create a new server project, then add it under a version control system.
GIT
EGit does not place the .git
directory into the project directory. It creates the local Git repository outside the project, creates a project directory within the repository, and links the project directory into the workspace.
Eclipse Plugin - Egit
-
Create a new local repository.
Open a new perspective.
Choose Git.
In Git Repositories tab, click the Create a new Git Repository and add it to this view icon.
In Create a Git Repository dialog, enter the path to the local Git repository.
Switch back to Data Shaper Perspective. -
Create a new Server Project.
-
Share the project with Team → Share wizard:
Right click the project name in the Project Explorer and choose Team > Share Project….
In the Share Project wizard, choose Git.
Create a new Git repository: click the Create… button in the upper right corner and choose new repository location.
If you intend to store more projects within one repository, enter Path within repository.
You usually do not check the Use or create repository in parent folder of project checkbox.
Click Finish.
The Git share wizard will move you project to the local Git repository and link the project to your workspace. -
Optionally, ignore the files or directories that you would not like to commit into repository: right click the file in Project Explorer and choose Team > Ignore.
-
Commit the changes into the local repository:
Right click the project in Project Explorer and choose Team > Commit.
Choose files, type the commit message, and click Commit. -
Push the changes into to the remote repository:
Switch to the Git perspective.
Unfold the Project.
Right click Remotes and choose Create Remotes….
Enter the name for remote repository. Usually, it is called origin.
In the second step of the wizard, click Change to specify the URI of remote repository. Enter URI and password and click Finish.
Click Advanced to specify tracking of remote branches. Choose branches below the Source ref and Destination ref titles.
Click Add spec to add the tuple to the list of tracked branches.
Tick Save specifications in 'remote' configuration. Click Finish to close Configure Push dialog.
Click Save and Push to save the branch tracking and to push the changes from local repository to remote one.
External GUI Tool - TortoiseGit
-
Create a new local repository.
Create a new directory for repository.
Right click this directory in the File Explorer and choose Git Create repository here … from the context menu.
Do not make it bare. -
Create a new Server Project. In the last step of the wizard, uncheck Use default location and enter the path to the local repository.
-
Make initial commit.
Right click the project directory and choose Git commit → "master" … from the context menu.
In the commit dialog, right click the files that you do not want to version and choose Add to ignore list > "the file name". In ignore dialog, use defaults.
Select all files in repository, type commit message and click commit. -
Configure the tracking of remote repository and push the local commit.
In File Explorer, right click the project and choose TortoiseGit > Push.
In TortoiseGit - Push dialog, click Manage.
In Settings - TortoiseGit, enter URL or remote repository and click OK.
Click OK to push the changes to remote repository.
Type the password and close the log.
External Tool - Command Line
-
Create a new local Git repository.
Typegit init /path/to/repository
-
Create a new Server Project. In the last step of the wizard, uncheck Use default location and enter the path to the local repository.
-
Optionally, add a list of files or directories that should not be versioned to
.gitignore
echo file_name >> .gitignore
-
Commit the changes to local repository.
git commit -a -m "Initial commit"
-
Add remote repository.
git remote add origin ssh://
-
Push the commits to remote repository.
git push --set-upstream origin master
SVN
Eclipse Plugin - Subclipse
-
Create a new (Synchronized) Server Project. See Data Shaper Server Project.
-
Share the project with Team → Share wizard.
Right click in Project Explorer and choose Team > Share Project… from the context menu.
In the Share project wizard, choose SVN.
Choose Use existing repository location.
Enter folder name. Click Next.
Type the Commit message. Click Finish.
The root directory of your project has been committed. -
Optionally, add a list of files or directories that should not be versioned to
svn:ignore:
In Project Explorer in Data Shaper Perspective, right click the file or directory and select Team > Add to svn:ignore….
The project has been created and the root directory has been committed into the repository.
You might need to commit the files and directories as well. See Committing into Repository.
External Tool - TortoiseSVN
TortoiseSVN does not let you choose particular files during the import into repository. Therefore you should create a project directory and import repository first. Then you can set up list of files or directories that should not be committed.
-
Create a project directory.
-
Commit the directory to repository:
Right click the directory and choose TortoiseSVN > Import.
In the dialog, enter the URL of repository and the commit message. Generally, the URL has a format:somePath/MyProjectName
. -
Check out the repository.
In FileExplorer choose the project directory and choose SVN Checkout… -
Create a new (Synchronized) Server Project. See Data Shaper Server Project.
-
Avoid committing of files or directories that should not be committed.
In File Explorer, right click the file or directory within the project and choose TortoiseSVN > Add to ignore list > "the file name" -
Commit the project:
In File Explorer, right click the project name and choose SVN Commit…
External Tool - Command Line
-
Create a project directory.
mkdir MyProject
-
Import the directory to repository.
svn import MyProject url_to_repository -m "Initial import"
-
Check out the committed directory. It converts the project directory into a working copy.
svn co url_to_repository/MyProject MyProject
-
Create a new server project.
-
Optionally, add files or directories to
svn:ignore
.
Move to the project and typesvn propset svn:ignore file_name
. -
Add files and commit the changes.
svn add *
svn commit -m "Initial import"
Connecting Server Project to Existing Repository
There is an existing Server sandbox with some data, graphs, etc. The content of the sandbox is in repository as well.
This section describes a way to create a new Server project corresponding to this sandbox and to attach the project with versioning system.
GIT
Cloning the remote repository and binding the content of an existing sandbox with the project from this repository is almost same as Initial Check-Out of Project from Repository.
The difference is that in the second step of the New Server Project wizard you should choose an existing sandbox.
Eclipse Plugin - EGit
-
Clone the repository.
Switch to Git perspective.
In Git Repositories tab, click the Clone a Git Repository and add the clone to this view icon.
Enter the remote repository location and password.
Choose branches to be tracked.
Enter the location at which the local repository will be created.
Switch back to Data Shaper perspective. -
Import the project from the local Git repository.
-
Convert the project to Server Project.
In the second step of wizard, choose an existing server sandbox.
In the last step of the wizard, choose the type of merge, e.g. Merge content - prefer remote files.
External Tool - TortoiseGit
-
Clone the git repository.
-
Import the project.
-
Convert project to Server Project.
External Tool - Command Line
1.Clone the Git repository.
git clone /path/to/remote/repo local_repo
-
Import the project.
-
Convert the project to Server Project.
SVN
Eclipse Plugin - Subclipse
1.Checkout the project from SVN.
-
Import the project.
-
Convert the project to Server Project.
External Tool - TortoiseSVN
-
Check out the repository to directory with project.
Right click the project directory in File Explorer and choose SVN Checkout…
Specify the checkout directory as current directory and click OK.
TortoiseSVN complains that the directory is not empty. -
Import the project.
-
Convert project to Server project.
External Tool - Command Line
-
Check out the project from SVN.
svn checkout --force /path/to/repository
-
Import the project.
-
Convert the project to Server Project.
Getting Changes from Repository
You have a server project connected to a repository. This section describes a way to get changes made by your colleagues from the repository.
GIT
In Git terminology, this process is known as git pull. Instead of pull, you can do fetch and merge, or fetch and rebase.
Eclipse Plugin - EGit
In Project Explorer, right click the project and choose Team > Pull
External Tool - TortoiseGit
-
In File Explorer, right click the project and choose TortoiseGit > Pull.
-
Choose origin and branch and click OK.
-
Close the log.
External Tool - Command Line
Switch to the local repository and type git pull
.
SVN
In SVN terminology, this process is known as svn update.
Eclipse Plugin - Subclipse
Right click the project name in Project Explorer, and choose Team > Update to HEAD from the context menu.
External Tool - TortoiseSVN
In File Explorer, right click the project directory and choose SVN Update from the context menu.
External tool - Command Line
Move to the project directory and type svn update
.
Committing into Repository
To commit changes into repository, you should have a versioned server project. You can either create a new one (see Adding Server Project to Version Control) or check out an existing one (see Initial Check-Out of Project from Repository).
GIT
Eclipse Plugin - EGit
-
Right click the project in Project Explorer, and choose Team > Commit.
-
Choose files, enter a commit message, and click Commit and Push.
-
Enter credentials.
-
View the changes and click OK.
External tool - TortoiseGit
-
In File Explorer, right click the project and choose Git commit → "master".
-
Type the commit message, choose files to be committed and click Commit.
You can change Commit to Commit & Push.
External Tool - Command Line
-
Add changes to staging area.
Within the repository, typegit add path/to/file(s)
. -
Type
git commit -m "The commit message"
to commit the changes. -
Type
git push
to push the changes to the remote repository.
SVN
Eclipse Plugin - Subclipse
-
In the Project Explorer view, right click the project name and choose Team > Commit…
-
Type the commit message, choose files to be committed, and click OK.
External Tool - TortoiseSVN
-
In File Explorer, right click the project directory and choose SVN Commit…
-
Choose the files to be committed, type a commit message and click OK.
External Tool - Command Line
-
Add files that you added with
svn add path/to/file
. -
Type
svn commit -m "The commit message"
to commit the changes.
Updated about 1 year ago