Version

    Adding Server Project to Version Control

    Git
    SVN

    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

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

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

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

    5. Commit the changes into the local repository:

      Right click the project in Navigator and choose TeamCommit.

      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 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
    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 the 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 the tracking of remote repository and push the local commit.

      In File Explorer, right click the project and choose TortoiseGitPush.

      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 the 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 be 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 CloverDX Server Project.

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

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

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

      In Navigator in CloverDX Perspective, right click the file or directory and select TeamAdd 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.

    1. Create a project directory.

    2. Commit the directory to repository:

      Right click the directory and choose TortoiseSVNImport.

      In the dialog, enter the URL of repository and the commit message. Generally, the URL has a format: somePath/MyProjectName.

    3. Check out the repository.

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

    4. Create a new (Synchronized) Server Project. See CloverDX 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 TortoiseSVNAdd 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"