Difference between revisions of "Git/Editing your Eclipse project Website using OrionHub"
|Line 56:||Line 56:|
That's it. You're done.
That's it. You're done.
Revision as of 00:15, 11 September 2012
OrionHub can be used to edit your Eclipse project website (and project code for that matter), with two important considerations.
- You cannot test your website on OrionHub using the Phoenix infrastructure; and
- OrionHub does not support PHP syntax highlighting out of the box.
Most projects don't test their websites with a locally-installed LAMP stack anyway, so the first issue is probably not too much of a concern.
Note that you need to be an Eclipse committer with access (write) permissions on the directories you want to work with for any of this to make sense.
Getting started with OrionHub
The first step is to register for an OrionHub account.
Once you have your account credentials, log in and navigate to the settings (you can find this by clicking your email address in the top-right corner and selecting "settings" from the drop-down. Navigate to the "User Profile" page and provide Git credentials. Use the same email address that you use to log into Eclipse properties (like the wiki, IPZilla, or Bugzilla). Click "Update".
You need to tell OrionHub this information so that it will associate it with commits that you make against Git repositories. If you do not provide it here, Orion will ask you for this information every time you commit.
Create a clone of your Website directory
The first thing that you need to know if the URL of the Git repository that you'd like to work with. In Git parlance, we need to make a clone of that repository on the OrionHub server. You will make edits in the local copy on OrionHub and then "push" your changes (commits) back to the Eclipse Git server.
Your project's website directory will be located under www.eclipse.org on the Git server. The website for your project will be in a directory named <project-short-name>.git (e.g. orion.git). Click on your project repository, scroll down to the bottom and copy the "ssh://..." URL listed under "Clone" (e.g. ssh://git.eclipse.org/gitroot/www.eclipse.org/orion.git).
Return to OrionHub and click on "Repositories" in the navigation bar at the top of the page. Click "Clone Repository" and paste the URL for your project's website. Modify the pasted URL to include your Eclipse committer id (e.g. ssh://firstname.lastname@example.org/gitroot/www.eclipse.org/orion.git). Click "Submit". OrionHub will ask for your ssh password. Enter your committer password. OrionHub will make a clone of your repository.
Note that you can make clones of any repository. You will be able to make local changes and commit them locally. You will only be able to push your local changes to the server if you are a committer on the project (or otherwise have write permission). g Click on "Navigator" in the navigation bar on the top of the page to see the cloned repository contents.
Note that you can open multiple OrionHub pages in your browser by right-clicking on links to "open in new tab|window".
- Greasemonkey Scripts make cloning a repository into OrionHub even easier;
Before starting any new work in your project website directory, be sure to update your clone of the repository.
Click on "Repositories" in the navigation bar at the top of the page. Click the "Pull from the repository" icon to the right of your repository (it's the icon that points up). You may be asked for your credentials; use your Eclipse committer password.
Click on "Show in navigator" to the right of the repository to review the contents and start editing. You can also click on "Navigator" in the navigation bar on the top of the page to access the files in your local workspace.
Editing is pretty straightforward. Expand the file hierarchy as necessary and click on a file to open the editor (note that you can right click to open the editor in a new tab or window if you wan to keep the Navigator open).
When you are done with your edits, flip back to the "Repositories" page. If you've made changes, your repository should be annotated with a brief status message (e.g. "1 file(s) to stage and 0 file(s) to commit.").
Click on "Git Status" to the right of your repository.
The files that you've changed should appear under "Unstaged". Click the "Stage the change" icon to the left of each change you want to commit (it's the icon that looks like a document with a down arrow). Do this for all of the changes that you want to commit. The files will move from "Unstaged" to "Staged".
Note that you can review the changes by clicking the "twistee" arrow to the left of the file name.
Click on the "Commit" button to right of the "Staged" section header. Enter a commit message describing your change and click "Submit".
To complete the operation, click the "Push All" button to the left of the "Commits..." section at the bottom of the page. If you are prompted, enter your committer password.
That's it. You're done.
Be sure to commit any work that you care about immediately. Any data left on OrionHub can be erased for various reasons. Any work that you commit and push will be safe.
Cleaning up your workspace
Use with care
On the "Repositories" page, click the "Git Status" link to the right of your repository. Click the "Reset" button to the right of the "Commits..." section.
Note that this will return your workspace to the current Git state. Any changed files that have not been committed will be reverted back to their last committed state (or removed if they were added).
Install PHP Syntax Highlighting