2

In .gitignore under the same directory there is

.factorypath
/.factorypath

added for eclipse project. But whenever any change occur in this file it is still visible as modified under git or smartgit.

Any idea why ?

Jacob
  • 14,949
  • 19
  • 51
  • 74
  • Was it tracked before you added it to gitignore? – Tim Mar 13 '15 at 09:31
  • Yes it was, but .factorypath is generated by eclipse as project property. This is required file but in later it's good to have it .ignored. – Jacob Mar 13 '15 at 09:38
  • possible duplicate of [Stop tracking and ignore changes to a file in Git](http://stackoverflow.com/questions/936249/stop-tracking-and-ignore-changes-to-a-file-in-git) – Tim Mar 13 '15 at 09:45

2 Answers2

8

Most likely the file .factorypath was added to git before you excluded it in .gitignore. From the gitignore documentation (http://git-scm.com/docs/gitignore):

NOTES The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked. To stop tracking a file that is currently tracked, use git rm --cached.

To show files currently tracked by git you can use git ls-files. As stated in the quote above to stop tracking the file use: git rm --cached .factorypath. This will keep your working tree copy of the file but remove it from the index.

jandob
  • 651
  • 5
  • 14
1

It's because the file was previously tracked. With that in mind, this question already has been answered here.

Community
  • 1
  • 1
Andy Brown
  • 11,766
  • 2
  • 42
  • 61