Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Remote vs local repositories(Newbie setup confusion)
Remote vs local repositories [message #1065439] Tue, 25 June 2013 17:06 Go to next message
Steve Sawyer is currently offline Steve SawyerFriend
Messages: 1
Registered: June 2013
Junior Member
I've read at least a half-dozen tutorials and other pieces of documentation, and searched this forum, and can't seem to find some explanation what seems to me to be a pretty basic issue.

In establishing a local repository, I note (as have others based on threads I've read on this forum) that all of the project files are moved OUT of the Eclipse workspace and INTO the local repository. So I'm starting to understand that the folder structure specified for the local repository becomes your local working directory, with all committed files (and all their revisions) stored in the .git folder within that top-level directory:

Repository_Folder/
    .git/
    Common/ (Project folder)
        Classes/
        Functions/


Do I have this correct?

If I do (and I hope that I've finally tumbled to this idea), there needs to be a remote repository to which the local repository can be "pushed" and from which my fellow team members can "pull" project files to their own local repositories.

Do I have this correct?

If so, how do I go about setting up this remote repository?

Thanks.



--Steve--
Re: Remote vs local repositories [message #1065577 is a reply to message #1065439] Wed, 26 June 2013 14:39 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
You have two different problems here, neither of which is specific to EGit. Your questions are about Eclipse in general and Git in general, not about EGit.

First, it was never a good idea to keep your project files in the workspace directory. I know it used to be common Eclipse practice some time ago, but it never made any sense and I'm happy to see that it's no longer recommended. The workspace directory is for workspace state and settings, which are very specific to Eclipse; project content on the other hand is independent of Eclipse. Two totally different kinds of things. Keep them separate and life will be much simpler. You should do this for all projects, regardless of what version control system you're using.

As for local v remote, this is basic Git, or, even more generally, basic distributed version control. You need to understand this before using Git or any Git helper tool like EGit (or SmartGit, or GitX or Tower or any other Git support app).
In the specific case of Git you also need to grasp the difference between bare and non-bare repositories.

Both topics should be covered early in any Git tutorial, but here's a short summary of what "bare" means: the repository has no working files or index.

Given which, the short answer to your second question is that you need to make a bare remote repository by running "git --bare init --shared" on the remote host. EGit is not involved in any way. Unless you're using ssh you'll probably also have to set up a Git service of some kind on that host (or your sysadmin will).







Re: Remote vs local repositories [message #1065607 is a reply to message #1065439] Wed, 26 June 2013 16:05 Go to previous message
Robert Emmons is currently offline Robert EmmonsFriend
Messages: 29
Registered: July 2009
Junior Member
Steve Sawyer wrote on Tue, 25 June 2013 13:06
I've read at least a half-dozen tutorials and other pieces of documentation, and searched this forum, and can't seem to find some explanation what seems to me to be a pretty basic issue.

In establishing a local repository, I note (as have others based on threads I've read on this forum) that all of the project files are moved OUT of the Eclipse workspace and INTO the local repository. So I'm starting to understand that the folder structure specified for the local repository becomes your local working directory, with all committed files (and all their revisions) stored in the .git folder within that top-level directory:

Repository_Folder/
    .git/
    Common/ (Project folder)
        Classes/
        Functions/


Do I have this correct?

If I do (and I hope that I've finally tumbled to this idea), there needs to be a remote repository to which the local repository can be "pushed" and from which my fellow team members can "pull" project files to their own local repositories.

Do I have this correct?

If so, how do I go about setting up this remote repository?

Thanks.




Hi Steve,

I am also new to Git, and struggling with some of the same issues. I have 2 suggestions to make:

* Use Git from the command line, rather than EGit for simple initial tasks
* Take a look at the tutorial below, which includes info on remotes

Here is the tutorial http://www.vogella.com/articles/Git/article.html

Git is a Unix command line tool. EGit is a GUI for this tool. Some simple things are just easier and clearer to me if you type a command, although EGit provides some great displays of info. After setting up your repository, and an initial commit, you can import the Git project into Eclipse.

YMMV.

[Updated on: Wed, 26 June 2013 16:06]

Report message to a moderator

Previous Topic:EGit push sometimes counts all the objects
Next Topic:Jgit commit peformance
Goto Forum:
  


Current Time: Wed Apr 24 17:48:21 GMT 2024

Powered by FUDForum. Page generated in 0.02949 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top