Jump to: navigation, search

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

< Orion‎ | How Tos
m
m (screen shots)
Line 3: Line 3:
 
A) These are steps to link a Git repository from a separate server:
 
A) These are steps to link a Git repository from a separate server:
 
# Start EclipseWeb server, go to http://localhost:8080/navigate-table.html# and log in
 
# Start EclipseWeb server, go to http://localhost:8080/navigate-table.html# and log in
# Choose 'Link folder' [image link-folder]
+
# Choose 'Link folder' [[Image:Howtogit--link_folder.png]]
 
# In the 'Link Folder' dialog enter the folder name and choose gitfs in the combo
 
# In the 'Link Folder' dialog enter the folder name and choose gitfs in the combo
# As the location use url like <code>git://github.com/<your name>/<repository>.git</code>, leave the Module field empty
+
# As the location use url like <code>git://github.com/<your name>/<repository>.git</code>, leave the Module field empty  
[image folder dialog]
+
[[Image:Howtogit--link_folder_dialog.png]]
  
 
Orion will create a local clone of the repository and store it on the server. The user will be not aware of the local clone, so the git repository location specified by the user is the only copy of the code the user knows about. His changes will be saved in the file system on the server and then automatically added to the git index and comitted to the local repository/clone. The local clone is required by the git client if we want to push the changes back to the external git repository (eg. located on github.com). Each user will have his own copy (local clone) of the remote git repository once he created/linked a new project (separate folder on the server). The problem is that we currently don't know [https://bugs.eclipse.org/bugs/show_bug.cgi?id=334120 how to push Git changes over SSH without storing a private key on the Orion server].
 
Orion will create a local clone of the repository and store it on the server. The user will be not aware of the local clone, so the git repository location specified by the user is the only copy of the code the user knows about. His changes will be saved in the file system on the server and then automatically added to the git index and comitted to the local repository/clone. The local clone is required by the git client if we want to push the changes back to the external git repository (eg. located on github.com). Each user will have his own copy (local clone) of the remote git repository once he created/linked a new project (separate folder on the server). The problem is that we currently don't know [https://bugs.eclipse.org/bugs/show_bug.cgi?id=334120 how to push Git changes over SSH without storing a private key on the Orion server].
Line 20: Line 20:
 
# Enter <code>git clone --bare git://github.com/zaza/test.git git-repo</code>
 
# Enter <code>git clone --bare git://github.com/zaza/test.git git-repo</code>
 
# Just like in B, you can now follow steps from A and use local filesystem location as the URL (e.g. <code>c:/temp/git-repo</code>)
 
# Just like in B, you can now follow steps from A and use local filesystem location as the URL (e.g. <code>c:/temp/git-repo</code>)
 
+
[[Image:Howtogit--link_folder_dialog2.png]]
[image folder dialog2]
+
 
   
 
   
 
I guess you can init a bare repository using EGit as well, but I'm still feeling more comfortable with a CLI.
 
I guess you can init a bare repository using EGit as well, but I'm still feeling more comfortable with a CLI.
  
 
If you experience any problems when following the steps above ping z4z4, or [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=e4&component=Orion&version=0.2 open a new bug] right away.
 
If you experience any problems when following the steps above ping z4z4, or [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=e4&component=Orion&version=0.2 open a new bug] right away.

Revision as of 07:45, 2 February 2011

First of all, to make Git file store available, you need to add org.eclipse.orion.server.filesystem.git and all dependencies to your launch configuration. If you're missing a dependency you should probably re-import project set from webide.psf. If it didn't help, ping z4z4 on IRC (use #eclipse-orion channel).

A) These are steps to link a Git repository from a separate server:

  1. Start EclipseWeb server, go to http://localhost:8080/navigate-table.html# and log in
  2. Choose 'Link folder' Howtogit--link folder.png
  3. In the 'Link Folder' dialog enter the folder name and choose gitfs in the combo
  4. As the location use url like git://github.com/<your name>/<repository>.git, leave the Module field empty

Howtogit--link folder dialog.png

Orion will create a local clone of the repository and store it on the server. The user will be not aware of the local clone, so the git repository location specified by the user is the only copy of the code the user knows about. His changes will be saved in the file system on the server and then automatically added to the git index and comitted to the local repository/clone. The local clone is required by the git client if we want to push the changes back to the external git repository (eg. located on github.com). Each user will have his own copy (local clone) of the remote git repository once he created/linked a new project (separate folder on the server). The problem is that we currently don't know how to push Git changes over SSH without storing a private key on the Orion server.

B) You may also create a local bare Git repository and share it among multiple Orion users. In this case changes are pushed to the shared repository and users may share their work.

  1. To create a repository you'll need a git client like msysgit (I'm using PortableGit downloaded from here).
  2. When in the git console go to a location on your disk where you want the repository to be created (e.g. c:/temp/git-repo).
  3. Enter git init --bare
  4. Now you can follow steps from A, but for the URL enter c:/temp/git-repo

C) Another option is to clone an existing repository, but make it bare while doing so. This way you can check out a project from GitHub and share your work with others at the same time. You won't be able to push your changes back to the GitHub though (see bug 334120 and the problem described above). Anyway, here are the steps for sharing an external repo:

  1. 1, 2, 3 as in B.
  2. Enter git clone --bare git://github.com/zaza/test.git git-repo
  3. Just like in B, you can now follow steps from A and use local filesystem location as the URL (e.g. c:/temp/git-repo)

Howtogit--link folder dialog2.png

I guess you can init a bare repository using EGit as well, but I'm still feeling more comfortable with a CLI.

If you experience any problems when following the steps above ping z4z4, or open a new bug right away.