1

I am trying to push my eclipse maven project to my GitHub repository but the folder structure it is mapping is wrong.

My Maven Project is named DocOcr and i am trying to push it to DocOcr repository on GitHub using Egit in Eclipse. Although it is copying files but its creating one more folder under gitub DocOcr repo named DocOcr and copying all files under it.

Now my pom.xml and src are getting copied to GitHub as {myusername}/DocOcr/DocOcr

i want my pom.xml and src to get copied to {myusername}/DocOcr/.

Can someone please help ?

1 Answer 1

3

Double-check where your .git is located locally: it should be in the same folder as where your pom.xml is.

If it is not, backup that .git (in case you have done multiple commit), and see if you can initialize a new one where your pom.xml is, and import it: re-share your project as described in "How make Eclipse/EGit recognize existing repository information after update?".

Or, as described in "When I commit a project an extra project dir is created", create the Git repo with the option "Use or create repository in parent folder of project" enabled, at the very top of the "Configure Git Repository" dialog (Team -> Share Project... -> Git)
Which is exactly what I meant by "it should be in the same folder as where your pom.xml is."

2
  • Thanks for answering but this answer solved my issue : stackoverflow.com/questions/12462784/…
    – Goro
    Commented Jul 10, 2017 at 3:48
  • 1
    @grsdev7 Yes, that is what I meant with "it should be in the same folder as where your pom.xml is.". I have included your link in the answer for more visibility.
    – VonC
    Commented Jul 10, 2017 at 4:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.