Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Orion/How Tos/Working with git"

< Orion‎ | How Tos
(Linking to a git clone already existing on your computer)
(Cloning a Git repository and linking to it)
Line 10: Line 10:
  
 
# [[Orion/How_Tos/Install_Orion_on_Localhost#Downloading_and_Running_Orion_on_Localhost|Download and run Orion]]
 
# [[Orion/How_Tos/Install_Orion_on_Localhost#Downloading_and_Running_Orion_on_Localhost|Download and run Orion]]
# Make sure <code>org.eclipse.orion.server.filesystem.git</code> is added your launch configuration
+
# Select Git Clone action.<br/>[[Image:Git_clone_action.png]]
# When [[Orion/How_Tos/Install_Orion_on_Localhost#Linking_to_existing_content|linking]] a project select <code>gitfs</code>, enter URL for a git repository and leave Module empty
+
# Enter the Git repository URL, your credentials and known hosts. For known hosts, you may use entries from known_hosts file in your SSH home directory.<br/>[[Image:Git_clone_dialog.png]]
# If you entered an existing location on your computer it must be a cloned repository, we won't be doing any smart detection here<br>[[Image:Howtogit--link folder dialog2.png]]
+
# When cloning is finished, the server location will be shown in the dialog.<br/>[[Image:Git_clone_finished.png]]
# For a git repository which requires authentication (e.g. starts with ssh://) to be able to clone it (and also fetch and push) you will need to wait for [https://bugs.eclipse.org/bugs/show_bug.cgi?id=334120 bug 334120] to be fixed<br>[[Image:Howtogit--link folder dialog.png]]
+
# Link a folder in your workspace to the given server location.<br/>[[Image:Git_clone_linking.png]]
# Under the hood, a git implementation of EFS will be used to clone the repository pointed by the URL. The file store's only role is to clone the repo. Modifying the working tree can be accomplish with the [[Orion/Server_API/File_API|File API]]. Adding files to the index, committing them and other git operations will be available via the [[#Git REST API|Git REST API]].
+
# Done!<br/>[[Image:Git_clone_added.png]]
  
 
= Using Orion Compare Viewer =
 
= Using Orion Compare Viewer =

Revision as of 20:23, 2 March 2011

Linking to a git clone already existing on your computer

  1. First clone a git repository to any location in your local filesystem, you can do with a tool of your choice (EGit, msysgit...)
  2. Download and run Orion
  3. Create a project and link it to the location you used in Step 1.
  4. Orion will automatically detect that the project is actually a git clone (we will probably make it configurable in the future)

Linking to a git repository using git file store

Warning2.png
Work in progress
This scenario has not been fully implemented yet.


  1. Download and run Orion
  2. Select Git Clone action.
    Git clone action.png
  3. Enter the Git repository URL, your credentials and known hosts. For known hosts, you may use entries from known_hosts file in your SSH home directory.
    Git clone dialog.png
  4. When cloning is finished, the server location will be shown in the dialog.
    Git clone finished.png
  5. Link a folder in your workspace to the given server location.
    Git clone linking.png
  6. Done!
    Git clone added.png

Using Orion Compare Viewer

Warning2.png
Work in progress
This scenario has not been fully implemented yet.

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.

  1. Download and run Orion or pull the latest code on both server and client side.
  2. Link a folder to your git repository.
  3. Open a file in the folder by Orion Editor.
  4. Change something and save the changes.
  5. Copy the "#/file/your_project/your_file" part from the editor URL as the file location.
  6. Paste it as the hash value of the viewer HTML(/js/compare/demo/demo-inline.html and /js/compare/demo/demo.html)
  7. 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)
Howtogit--in-line-viewer.png
  • 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)
Howtogit--side-by-side-viewer1.png

Using Orion Git Status Page

Warning2.png
Work in progress
This scenario has not been fully implemented yet.

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.

Howtogit--git-status new.png

  1. 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.
  2. 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.
  3. On the left hand , all the unstaged and staged changes are listed up in two areas.
  4. 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.
  5. 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.
  6. 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.
  7. 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.

Bugs, comments, feedback

If you experience any problems when following the steps above ping z4z4 or SzymonB on IRC (use #eclipse-orion channel), or open a new bug right away.

Back to the top