7

I use Eclipse EGit plugin to work with git repository. (I even use it for local projects to track changes made by tools.)

However I discovered problem that makes usage for team projects not so good:
When renaming a folder or file, I get to commits 2 items: 1 to add as new, and 1 to delete. This way there is no history who & when edited this file, no way to look back at evolution.

This problem is likely not caused by EGit, but git. See answer for Renaming in Git and Mercurial: Accuracy and automaticity

How to keep history of files when a lot of refactoring and renaming is going on?

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • possible duplicate of [Why does git confuse removal with rename/copy?](http://stackoverflow.com/questions/4586988/why-does-git-confuse-removal-with-rename-copy) – CharlesB Dec 11 '12 at 09:14
  • 2
    I don't know much about Egit, but do you have [rename tracking turned on](http://wiki.eclipse.org/EGit/User_Guide#Configuring_the_View)? – John Szakmeister Dec 11 '12 at 10:03
  • I have edited test. I need to keep history of file changes. @jszakmeister There's no option to track only 1 operation. It has no sense. – Paul Verest Dec 12 '12 at 13:30
  • 1
    @PaulV I'm sorry, but I don't understand your reply. Judging by the documentation, it appeared that turning on the "track renames" option I linked to above would allow the history view to follow across the add+delete. Git track renames at all... it deduces that after the fact, but only with the right options turned on. – John Szakmeister Dec 13 '12 at 08:24

3 Answers3

3

See the Git FAQ, section Why does git not "track" renames?,

This however does not answer how to keep history when usit EGit in Eclipse. I need to try

p.s. Link for EGit. // Thanks to jszakmeister

http://wiki.eclipse.org/EGit/User_Guide#Configuring_the_View

guerda
  • 23,388
  • 27
  • 97
  • 146
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
2

Note that with EGit 3.0, Rename detection was added to the file diff viewer in the History view and Commit editor (bug 335082):

rename detection with EGit 3.0

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

See git help log, particularly the --follow option.

Don't know how to do this in Egit, though, but if Egit isn't doing what you want, why not use other tools to supplimement the basic functionality?

Arafangion
  • 11,517
  • 1
  • 40
  • 72