0

I have a file structure similar to this in my project:

-project root
  .gitignore
  -Scripts (folder)
    fileA.js
    fileB.js
    -maps (folder)
      fileA.js.map
      fileB.js.map

And a .gitignore file that contains:

**/*.map
Scripts/**

(among other entries)

However, when I use Visual Studio 2013 to stage a commit (right-click on solution and select Commit) I still see fileA.js.map, fileB.js.map and fileA.js (but NOT fileB.js) in the "Included Changes" section.

This is a brand new repo, with no commits so Git is not aware of any of these files. These files are generated by Gulp which is why I do not want them in my repo.

I've tried so many different permutations in .gitignore that I can't remember them all. Any ideas as to what I'm doing wrong?

Thanks.

TimTheEnchanter
  • 3,370
  • 1
  • 26
  • 47
  • Where the files part of repository before? In that case you need to reset them, and after that they will be ignored by git – romants Jul 30 '15 at 23:05
  • Is your goal to ignore the maps folder, or ignore all .map files in your project? Also, the line `Scripts/**` looks like it's attempting to ignore the entire Scripts folder, but that's not what you wanted, right? – Maximillian Laumeister Jul 30 '15 at 23:07
  • @Roman: no these are all new files. – TimTheEnchanter Jul 30 '15 at 23:08
  • @Maximillian: This sample is just an excerpt of my full project, but yes, I'm trying to ignore all map files in Scripts\maps as well as ignore all .js files in Scripts – TimTheEnchanter Jul 30 '15 at 23:09
  • @David Do you want to ignore the entire Scripts folder and everything in it, or only the *.js files in it? Ignore the entire maps folder and everything in it, or only the *.map files in it? – Maximillian Laumeister Jul 30 '15 at 23:11
  • Ignore .js files in Scripts and everything in Scripts\maps – TimTheEnchanter Jul 30 '15 at 23:16
  • So it appears that the VS2013 Team Explorer is showing ignored files. When I open the project using Git Extensions (version 2.47.3) the files to be committed are correct. When I opt in the Commit dialog Git Extensions to show Ignored Files, the errant files show up. I can't find any way to configure Team Explorer, so I'm assuming this is a bug? Seems pretty major to have been around this long, unless it's "as-designed" and I'm just approaching it wrong. It's weird that only some ignored files show up, though... – TimTheEnchanter Jul 31 '15 at 00:30
  • this may help you https://stackoverflow.com/a/28807810/202 – Christian Hagelid Jul 31 '15 at 13:15
  • @ChristianHagelid: Yep, that did the trick! Thanks. – TimTheEnchanter Jul 31 '15 at 13:30

0 Answers0