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
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.
Create a new Server Project.
Share the project with Team -> Share wizard:
Right click the project name in the Project Explorer and choose → .
In the Share Project wizard, choose Git.
Create a new Git repository: click the
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
.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 → .
Commit the changes into the local repository:
Right click the project in Project Explorer and choose → .
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
to specify the URI of remote repository. Enter URI and password and click .Click Source ref and Destination ref titles. Click to add the tuple to the list of tracked branches.
to specify tracking of remote branches. Choose branches below theTick Save specifications in 'remote' configuration. Click to close Configure Push dialog.
Click
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 → . In ignore dialog, use defaults.
Select all files in repository, type commit message and click
.Configure the tracking of remote repository and push the local commit.
In File Explorer, right click the project and choose → .
In TortoiseGit - Push dialog, click .
In Settings - TortoiseGit, enter URL or remote repository and click .
Click
to push the changes to remote repository.Type the password and close the log.
External Tool - Command Line
Create a new local Git repository.
Type
git 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://git@127.0.0.1:30022/home/git/repos/Project.git
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
Create a new (Synchronized) Server Project. See CloverDX Server Project.
Share the project with Team -> Share wizard.
Right click in Project Explorer and choose → from the context menu.
In the Share project wizard, choose SVN.
Choose Use existing repository location.
Enter folder name. Click
.Type the Commit message. Click .
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 CloverDX Perspective, right click the file or directory and select → .
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
→ .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 CloverDX 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 → →
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 type
svn propset svn:ignore file_name
.Add files and commit the changes.
svn add *
svn commit -m "Initial import"