4

I have a computer running Ubuntu Server. On this computer I have a user named mattgit.
I have another computer running Windows 7. I develop Java applications in Eclipse on this computer.

On my server, I have run "git init --shared --bare" to create a central repository for an Eclipse project. I've done this once for each project in my Eclipse workspace, each in a separate folder.

I want each project in my Eclipse workspace on my Win7 machine to act as a/be a/whatever the terminology is git repository. I want to be able to then push these files back to the central repository on my server. How do I do this?

I've tried cloning the (initially empty) central repository to my Win7 machine to a folder in my Eclipse workspace and then creating a project in there, but Eclipse refuses to create it because it says the directory isn't empty.

I've also tried creating the project using Eclipse in my workspace, then cloning the repository into that folder, but apparently I'm not allowed to do that either.

I've tried using SmartGit and the Git binary and I'm just getting more and more confused.

EDIT: Please assume I know absolutely nothing about what I need to do. I need step-by-step instructions.

Matthew G
  • 1,090
  • 2
  • 14
  • 23

2 Answers2

4

You will need three things:

  • a Git listener service able to listen to your git command (and you don't need gitolite at all here: it is an authorization layer).
    See GitStack for Windows (there is a free version)
  • a git Eclipse plugin including in your Eclipse in order to not switch context when you want to do a Git operation: make sure EGit is installed in your Eclipse.
  • some instructions importing your existing Eclipse project into a local git repo and to declare your Windows GitStack repo as a remote, in order to push to it.

The instructions of Egit on GitHub are quite complete.
The Vogella's tutorial on Egit is also nicely done.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
2

The simpler way to do that is to create your new project within Eclipse, then right click on the project and go to Team > Share menu. This interface will guide you to create a new local repository containing your new Eclipse project. Once your project is managed on a local git repository, Eclipse will give you other context menu entries to manipulate the project on Git. So you will be able to push your commits on your remote repository (the one you created on your server).

greydet
  • 5,509
  • 3
  • 31
  • 51