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
(New page: First of all, to make Git file store available, you need to add org.eclipse.filesystem.git and all dependencies to your launch configuration. If you're missing a dependency you should prob...)
 
m
Line 1: Line 1:
First of all, to make Git file store available, you need to add org.eclipse.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 [http://wiki.eclipse.org/IRC #eclipse-orion].
+
First of all, to make Git file store available, you need to add <code>org.eclipse.orion.server.filesystem.git</code> 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:
 
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 link-folder]
## 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 git://github.com/<your name>/<repository>.git (this one is a real url you can use for testing purposes), 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 folder dialog]
  
Line 11: Line 11:
  
 
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.
 
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.
## To create a repository you'll need a git client like msysgit (I'm using PortableGit downloaded from [http://code.google.com/p/msysgit/downloads/list here]).
+
# To create a repository you'll need a git client like msysgit (I'm using PortableGit downloaded from [http://code.google.com/p/msysgit/downloads/list here]).
## 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).
+
# When in the git console go to a location on your disk where you want the repository to be created (e.g. <code>c:/temp/git-repo</code>).
## Enter git init --bare
+
# Enter <code>git init --bare</code>
## Now you can follow steps from A, but for the URL enter c:/temp/git-repo
+
# Now you can follow steps from A, but for the URL enter <code>c:/temp/git-repo</code>
  
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 task 467 and the problem described above) (see also Enh 384). Anyway, here are the steps for sharing an external 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 [https://bugs.eclipse.org/bugs/show_bug.cgi?id=334120 bug 334120] and the problem described above). Anyway, here are the steps for sharing an external repo:
## 1, 2, 3 as in B.
+
# 1, 2, 3 as in B.
## Enter git clone --bare git://github.com/zaza/test.git git-repo
+
# 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. c:/temp/git-repo)
+
# 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 folder dialog2]
 
[image folder dialog2]

Revision as of 07:41, 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' [image link-folder]
  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

[image folder dialog]

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)

[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.

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

Back to the top