2

I'm trying to set up EGit with Eclipse and I've used neither of them before. I understand the basics around Git and Eclipse is more or less just another IDE. The problem I'm having is setting up a reasonable work environment.

I have file-server at home which I want to use as a Bare repository which I push and pull changes to. To test it out I've done the setup locally.

  • I have a bare repository created through the Git Repository perspective.
  • I've cloned that repository into a local non-bare repository.
  • I've created a project in a subdir of the non-bare repository (is this the way to go? Is it possible to do have the project directly in the workspace with the .git folder within it? So far I've had a lot of trouble with it when trying to create an Eclipse project out of it. What is the proper way to do it?)
  • I've made some changes to this cloned repository and added the indexes, committed the changes and attempted to push the changes to upstream.

The thing is that no changes are made to upstream. Would someone like to explain the procedure in doing the push so that I'm not misunderstanding something? Or am I completely wrong on utilizing a bare repository instead of just working non-bare?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Niklas
  • 465
  • 2
  • 9
  • 19

1 Answers1

2

As mentioned in this tutorial, you create your Git repo right where your project is (ie your .classpath and .project files are).

create-repo

Pushing to a bare repo is a good idea (see the links mentioned in "Git - pull & push - production server")

You need though to specify what you want to push:

egit push

Click at least on "Add all branch spec".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks I'll try this out as soon as I can and afterwards mark it as the selected answer. – Niklas May 18 '12 at 09:57
  • Ha! It works! I think that my problem earlier was that I excepted to see the "working directory" in the bare repository, but when I cloned the bare repository I retrieved all the files which I had previously pushed. So it works! Thanks! – Niklas May 18 '12 at 11:49
  • @Niklas glad you made it work. Just to be sure, the main characteristic of a bare repo is the *absence* of a working directory. Which make it fit, by the way, to be an upstream repo to which you can push to (as illustrated in http://stackoverflow.com/questions/10607422/understanding-git-connect-branch-to-a-remote-repository/10649111#10649111 and http://gitready.com/advanced/2009/02/01/push-to-only-bare-repositories.html) – VonC May 18 '12 at 11:56
  • thank you VonC for the additional links, I have a much better understanding of Git now! :) – Niklas May 20 '12 at 20:47