Home | Table of Contents | Adding Server Project to Version Control | CloverETL 4.6.1
--- | --- | ---
Prev | Versioning of Server Project Content | Next

### Adding Server Project to Version Control

Git
SVN

This section describes way to create a brand new versioned server project and to commit it to a new remote repository. It describes the way add an existing unversioned server project to the repository as well.

Generally, create a new server project. Then add it under version control system.

#### Git

Eclipse Plugin - Egit
External GUI Tool - TortoiseGit
External Tool - Command Line

EGit does not place `.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

1. Create a new local repository.

   Open a new perspective.

   Choose Git.

   In Git Repositories tab, click 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 CloverETL Perspective.

2. Create a new Server Project.

3. Share the project with Team -> Share wizard:

   Right click the project name in the Navigator 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.

   Enter Path within repository if you intend to store more projects within the one repository.

   You usually do not check 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.

4. Optionally, ignore the files or directories that you would not like to commit into repository: right click the file in Navigator and choose Team → Ignore.

5. Commit the changes into the local repository:

   Right click the project in Navigator and choose Team → Commit.

   Choose files, type the commit message, and click Commit.

6. 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 wizard click Change to specify URI of remote repository. Enter URI and password and click Finish.

   Click Advanced to specify tracking of remote branches. Choose branches below 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

1. 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.

2. Create a new Server Project. In the last step of wizard uncheck Use default location and enter the path to the local repository.

3. 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.

4. Configure tracking of remote repo 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

1. Create a new local git repository.

   Type `git init /path/to/repository`

2. Create a new Server Project. In the last step of wizard uncheck Use default location and enter the path to the local repository.

3. Optionally, add a list of files or directories that should not versioned to `.gitignore`

   `echo file_name >> .gitignore`

4. Commit the changes to local repository.

   `git commit -a -m "Initial commit"`

5. Add remote repository.

   `git remote add origin ssh://git@127.0.0.1:30022/home/git/repos/Project.git`

6. Push the commits to remote repository.

   `git push --set-upstream origin master`

#### SVN

Eclipse Plugin - Subclipse
External Tool - TortoiseSVN
External Tool - Command Line

##### Eclipse Plugin - Subclipse

1. Create a new (Synchronized) Server Project. See CloverETL Server Project.

2. Share the project with Team -> Share wizard.

   Right click in Navigator 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.

   Root directory of your project has been committed.

3. Optionally, add list of files or directories that should not be versioned to `svn:ignore`:

   In Navigator in CloverETL 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 shall create a project directory and import repository first. Then you can set up list of files or directories that should not be committed.

1. Create a project directory.

2. 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 format: `somePath/MyProjectName`.

3. Check out the repository.

   In FileExplorer the project directory and choose SVN Checkout...

4. Create a new (Synchronized) Server Project. See CloverETL Server Project.

5. 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"

6. Commit the project:

   In File Explorer, right click the project name and choose SVN Commit...

##### External Tool - Command Line

1. Create a project directory.

   `mkdir MyProject`

2. Import the directory to repository.

   `svn import MyProject url_to_repository -m "Initial import"`

3. Check out the committed directory. It converts the project directory into a working copy.

   `svn co url_to_repository/MyProject MyProject`

4. Create a new server project.

5. Optionally, add files or directories to `svn:ignore`.

   Move to the project and type `svn propset svn:ignore file_name .`

6. Add files and commit the changes.

   svn add *

   svn commit -m "Initial import"

Prev | Up | Next
Initial Check-Out of Project from Repository | Home | Table of Contents | Connecting Server Project to Existing Repository