Git server with eclipse project

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

On my server, I ran "git init --shared --bare" to create a central repository for the Eclipse project. I did this once for each project in the Eclipse workspace, each in a separate folder.

I want every project in my Eclipse workspace on my Win7 machine to work like / be / what, terminology is a git repository. I want to be able to then move these files back to the central repository on my server. How to do it?

I tried to clone the (initially empty) central repository of my Win7 machine into a folder in the Eclipse workspace and then create a project there, but Eclipse refuses to create it because it says that the directory is not empty.

I also tried to create a project using Eclipse in my workspace, and then cloned the repository into this folder, but apparently I was not allowed to do this either.

I tried using SmartGit and git binary, and I just got more and more confused.

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

+4
source share
2 answers

You will need three things:

  • a Git is a listening service that can listen to your git command (and you don’t need gitolite at all: this is the authorization level).
    See GitStack for Windows (free version available)
  • a Git Eclipse plugin , including in your Eclipse, so as not to switch context when you want to perform a git operation: make sure that EGit is installed in your Eclipse.
  • some instructions to import an existing Eclipse project into a local git repository and declare the Windows GitStack repository as remote to click on it.

Egit instructions on GitHub are pretty complete.
Vogella's Egit tutorial is also well done.

+3
source

An easier way to do this is to create a new project in Eclipse, then right-click on the project and go to the Team> Share menu. This interface helps you create a new local repository containing the new Eclipse project. When your project is managed in the local git repository, Eclipse will provide you with other entries in the context menu for managing the project on Git. This way you can push your commits to the remote repository (the one you created on your server).

+2
source

Source: https://habr.com/ru/post/1443144/


All Articles