Orion/How Tos/Working with git
Linking to a Git clone already existing on your computer
- First clone a git repository to any location in your local filesystem, you can do with a tool of your choice (EGit, msysgit...)
- Download and run Orion
- Create a project and link it to the location you used in Step 1.
- Orion will automatically detect that the project is actually a Git clone (we will probably make it configurable in the future)
Cloning a Git repository
For detailed instruction how to clone repository from GitHub view Orion/How Tos/Cloning repository from github
- Download and run Orion
- Click the Repositories link to go to the Git Clones viewer.
- Select the Git Clone action.
- Enter the Git repository URL, and click Next.
- Now enter your credentials. Which fields are required depends on the specific repository you're connecting to.
- When cloning is finished, you'll see the new clone appear in the list:
- Hover over the Actions column and click the Link button.
- Type in a name, and click OK. The clone will be linked to a new folder in your workspace with that name.
- Done! You'll be taken to the folder and you can start using Orion's git tools on your new clone.
Using Orion Compare Viewer
Although still in progress , you can now use both in-line and side-by-side compare viewer from Orion.Currently you have to use the viewer HTML directly in your browser and use your file location as the hash of the html. Please also note that the compare viewer container UI will be changed later to fit better layout.
- Download and run Orion or pull the latest code on both server and client side.
- Link a folder to your git repository.
- Open a file in the folder by Orion Editor.
- Change something and save the changes.
- Copy the "#/file/your_project/your_file" part from the editor URL as the file location.
- Paste it as the hash value of the viewer HTML(/js/compare/demo/demo-inline.html and /js/compare/demo/demo.html)
- Below are the format and examples.
- In-line viewer :
http://Your_server:8080/js/compare/demo/demo-inline.html#/file/your_project/your_file ( e.g. http://localhost:8080/js/compare/demo/demo-inline.html#/file/K/bundles/org.eclipse.orion.client.core/static/js/compare/demo/demo-inline.html)
- Side-by-side viewer(as planned , this viewer will become the merge editor):
http://Your_server:8080/js/compare/demo/demo.html#/file/your_project/your_file ( e.g. http://localhost:8080/js/compare/demo/demo.html#/file/K/bundles/org.eclipse.orion.client.core/static/js/compare/demo/demo-inline.html)
Using Orion Git Status Page
Please note that the section is currently used for developer's discussion.The UI shown below is the developer's UI mockup. The functionality is addressed in a high level.
- Similiar to the compare viewer , the URL format of the git status page is : http://localhost:8080/git-status.html#/file/K/bundles/org.eclipse.orion.client.core/static/js/compare/.
Here you pass the directory path to the html.The page will show you the git status under that directory.
- There will be an action somewhere in the navigator to open this page so that user does not have to input the directory as the hash.
- On the left hand , all the unstaged and staged changes are listed up in two areas.
- Clicking on any line will high-light it and the right hand side viewer will show the difference of that file against the Git repo.
- On the unstaged area , hovering on any line pops up two action buttons : compare and stage. The compare action navigates user to a side by side compare viewer. The stage action will stage the file represented by the line.
- On the staged area , hovering on any line pops up two action buttons : compare and unstage. The compare action navigates user to a side by side compare viewer. The unstage action will unstage the file represented by the line.
- The side by side viewer is planned to be upgraded to a compare merge editor post M6.
Git REST API
This section was moved to Orion/Server_API/Git_API.