1

I have a git repository on my NAS. I use from Windows and Linux SmartGit/Hg for interface with it.
I had to took some old repository make in TFS and convert into GIT one, so far so good (difficult procedure but I had success). For the new project I can tell GIT (before the first "commit") which directory I want to exclude, however the converted repository automatically put in git some directory that heritace from TFS. I suppose that TFS also had all the change of this directory.

So I thought that I can tell to GIT to ignore this directory but from SmartGit/Hg seems that if a directory/file is committed once I can't put it into ignore directory, so how can I tell to git to ignore for the future that directory?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
pinguinone
  • 433
  • 1
  • 6
  • 14
  • This is basically a [duplicate question](http://stackoverflow.com/questions/17820056/git-diff-doesnt-ignore-specified-files-in-gitignore) – vgoff Oct 22 '14 at 06:15
  • possible duplicate of [Ignore files that have already been committed to a Git repository](http://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository) – Sascha Wolf Oct 22 '14 at 06:56

2 Answers2

2

You need to remove that folder from your index (but not from your disk):

git rm --cached -r yourFolder

(See "gitignore after commit" and "How to remove a directory in my GitHub repository?")

Then the .gitignore will be able to ignore the folder.

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

You can use a gitignore file. Here you can define which directories and files will not commited.

Click on the link below: https://help.github.com/articles/ignoring-files/

Kevin

Kevin Sch
  • 31
  • 1
  • 6