1

I have an android project in Eclipse. I have it under git version control. I am not using the Eclipse-built-in git manager. I'm managing git commits in command line. When I switch back and forth between branches that do/do not have certain files, I don't know how to get Eclipse to recognize these files.

I tried to drag and drop the file from my OS's file explorer into Eclipse's Package Explorer. I've also tried to use the import wizard. Both times I get a "Source is in the hierarchy of the destination" error.

screen shot

So Eclipse obviously knows that the file is already in the project's folder structure. How can I get Eclipse to automatically add files to the Package Explorer every time it detects a new file (i.e. when I git checkout _____)?

I only ask because I've had this feature in other IDE's and it was great when using git.

tir38
  • 9,810
  • 10
  • 64
  • 107

2 Answers2

2

I am not using the Eclipse-built-in git manager.

Congratulations (seriously)

How can I get Eclipse to automatically add files to the Package Explorer every time it detects a new file

automatically I don't know

Select the project and hit F5 - refresh is a must in eclipse - sometimes also a Project > clean is needed

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
  • Ahh! The missing part was "Select the project". I just hit F5 with the editor in focus. Now it works! – tir38 Sep 18 '13 at 19:21
0

If you use the Eclipse git tool it will automatically refresh your project when it detects that you have checked out another branch. You can still use git from the command line, i.e. check out branches, commit and all the things you do today.

You can also manually refresh the project, right-click the project and choose Refresh - the files should appear.