-
Notifications
You must be signed in to change notification settings - Fork 0
Eclipse Git cheat sheet
Building and delivering DITA Open Toolkit code into the new GIT version control system integrates a few extra steps in order to retrieve and deliver content compared to CVS and SVN integration in Eclipse Workbench. Hopefully, this doc will shed some light on the process and make it easier for developers using Eclipse to build and fix content for DITA OT and share that code with the rest of the community.
Some care is needed in this step to ensure the code is from the proper branch so the updated code can be delivered to the proper branch. For DITA OT one should not be retrieving or delivering code to the master branch.
- Select 'File' --> 'Import...'.
- Select 'Git' --> 'Projects from Git' from the wizard, then click 'Next'.
- Select the 'Clone...' button.
- Type git@github.com:dita-ot/dita-ot.git in the URI text field in the new wizard.
- Enter you user id to connect to the repository, then click 'Next'.
- Enter you password to connect to the repository
- Select branch you for the project.
- Select 'Next'
- Select a local destination directory for the code.
- Select 'Finish'.
Now we want to create the base Java project in Eclipse for the code in the repository. Initially, it will be a blank Java project.
- From the menu, select 'File' --> 'New' --> Java Project
- Enter a name for the project in 'Project name' text field.
- Type the location of the workspace in the 'Location' text to be the same location as the repository on your local file system.
- Click 'Next'
- Remove excessive source folders from the build path. Only the 'src/main/java' and 'src/test/java' folders should be listed.
- The 'Default output folder' should be 'dita-ot1.5.4/target/classes'.
In order to get all of the pop-up menu items for Git to appear in the context menu, the Git repository needs to be associated with the newly created Java project.
- Right-click the project folder, then select 'Team' --> 'Share Project...'
- Select the appropriate configured repository that's associated with the Eclipse workbench
This is a little different process if you were used to committing content in CVS. Committing content in CVS meant that the updated code was delivered to the source repository on SourceForge. With Git, you need to commit content to your local repository before pushing things to the project source control.
Once you completed the updates to the code (say for a defect or feature) you can commit the code to your local repository. You can keep any number of updates in your local repository until you're ready to push the updates to GitHub.
The first time you want to push updated code to remote Git repository for DITA OT you will need to setup a few things.
- To push content you need to right-click the main project folder, the select 'Team' --> 'Push..'
- Select the push destination using the already configure remote repository.
- Select the source and destination branches. The press the 'Add Spec' button.
- Then click 'Finish'
- Then it should ask you for your GitHub user Id and password. If everything is okay, then your code should be visible in the build. You can verify your updates made it into the repository here.