1

I'm learning to use github and here's my problem.

I uploaded my program to github as always (git add, commit, push). Then I noticed that the files in one of the folders are missing, replaced by .gitignore

The contents of the "src" folder should be as follows:

src -> model, controller
    model -> x.java, y.java z.java
    controller -> w.java

Instead of the above, there is only a single .gitignore file in src. The contents of the file are something like:

/model/
/controller/

Why did this happen and how can I fix this?

user3614293
  • 385
  • 5
  • 13
  • 1
    `.gitignore` files usually do not appear magically all around. Are you sure it's a project of yours? Did you copy something from somewhere else? Anyway, simply drop the file from the `src`. – skypjack Oct 15 '15 at 07:12

1 Answers1

1

That can happen for instance with EGit: the preference settings under Team > Ignored Resources can define "derived" flag, which will generate a .gitignore.

If model and controller folder were considered as "derived" (ie "generated"), EGit might have generated that .gitignore.

To fix it, check your preferences,

derived

Also git add --force those folders, delete that .gitignore, commit and push.

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