Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Can't add Copy-Pasted file to index
Can't add Copy-Pasted file to index [message #1646738] Tue, 03 March 2015 04:50 Go to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
I'm using Eclipse Luna Java/DSL package and using EGit. It's been working great until a few days ago. I copied/pasted/renamed a source file from within Project Explorer and this new file refuses to get added to the index. I tried deleting and re-adding it to the index but nothing has helped so far.

Eclipse DSL Tools

Version: Luna Service Release 1a (4.4.1)
Build id: 20150109-0600

Eclipse Git Team Provider 3.4.2.201412180340-r org.eclipse.egit.feature.group Eclipse EGit

[Updated on: Sun, 29 March 2015 14:41]

Report message to a moderator

Re: Can't add new file to index [message #1654106 is a reply to message #1646738] Fri, 06 March 2015 14:40 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
- Is this file contained in an Eclipse project ?
- Did you copy the file in Eclipse or externally ?
- If you copied it outside Eclipse you might need to call "Refresh" in Eclipse on the containing folder or project.
Re: Can't add new file to index [message #1655145 is a reply to message #1654106] Sat, 07 March 2015 00:51 Go to previous messageGo to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
Matthias Sohn wrote on Fri, 06 March 2015 09:40
- Is this file contained in an Eclipse project ?
- Did you copy the file in Eclipse or externally ?
- If you copied it outside Eclipse you might need to call "Refresh" in Eclipse on the containing folder or project.


I copied and pasted the file in the Eclipse Project Explorer window. Gave it a new name along the way. Tried it again, just accepted the "Copy of...." default name and the same problem with that file as well.
Re: Can't add new file to index [message #1659398 is a reply to message #1655145] Sun, 08 March 2015 20:27 Go to previous messageGo to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
Here's some more context.

I am using Eclipse DSL for Java. You open the first instance of Eclipse and write your DSL (plugin) code. When you launch this, you launch a new Eclipse application where you use the plugins and write Java code.

Copying a source file works fine in the second instance of Eclipse. When you do that, the new file icon appears in Project Explorer with a little "?" in the lower right corner. If you rename a file, it shows up with a "+" on it, to automatically add itself to your Git repository. In the first instance of Eclipse, the icon appears but no Git icon overlay ever shows up.

This is the console output from the first Eclipse:

Quote:
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.dsl.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.e
pp.package.dsl.product -consolelog

!ENTRY org.eclipse.core.resources 2 10035 2015-03-08 09:54:08.780
!MESSAGE The workspace exited with unsaved changes in the previous session; refr
eshing workspace to recover changes.

!ENTRY org.eclipse.egit.ui 2 0 2015-03-08 09:55:17.554
!MESSAGE Warning: The environment variable HOME is not set. The following direct
ory will be used to store the Git
user global configuration and to define the default location to store repositori
es: 'C:\Users\User'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherw
ise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings
preference page.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further detail
s.

Re: Can't add new file to index by Copy-Paste in Project Explorer [message #1690584 is a reply to message #1659398] Sun, 29 March 2015 14:11 Go to previous messageGo to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
This is so repeatable I'm surprised nobody else reports it. So, how do you copy an existing file in your project to a new file and add it to the index? Copy-Paste in Project Explorer clearly does not work.
Re: Can't add new file to index by Copy-Paste in Project Explorer [message #1691989 is a reply to message #1690584] Sat, 11 April 2015 15:03 Go to previous messageGo to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
You're all going to laugh, but all of the files in question had been magically added to the .gitignore file. So I cleared that out and it works fine now. I had never looked at the .gitignore before... is there a way to prevent copy/pasted or open/save as files from automatically getting .gitignored? Because when I copy or rename something I usually want it part of the project.
Re: Can't add new file to index by Copy-Paste in Project Explorer [message #1692060 is a reply to message #1691989] Mon, 13 April 2015 06:19 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
If the preference "Team > Git > Projects > Automatically ignore derived resources" is switched on EGit will
auto-ignore derived resources (typically generated by the build, e.g. class files).
Previous Topic:Confused newbie
Next Topic:Luna 4.4.2 + JDK 8 : cannot open git-upload-pack
Goto Forum:
  


Current Time: Thu Apr 18 09:02:35 GMT 2024

Powered by FUDForum. Page generated in 0.02201 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top