0

We use Web Essentials in our Visual Studio project, and we use a main Site.Less file that compiles into Site.css, and Site.css.map & Site.min.css.

Because Less is a new technology to some team members we sometimes get people writing code into the Site.css file and checking that in. Recently we had a week's worth of changes that got overwritten because somebody else changed the Less file, compiled and checked in. Thankfully the history kept the .css changes.

Is there a way to prevent the Site.css file, which is underneath Site.less, from being checked in? This would serve as a reminder that people need to edit the Less file and not the CSS file.

VictorySaber
  • 3,084
  • 1
  • 27
  • 45
  • I hope (and it seems so) that you're using a versioning system. If you use for example Git, you can set `.gitignore` to prevent that Git watches for edits in `Site.css`. Obviously, doing this, processed file must be generated during deploy on webserver due to fact that is no longer versioned (and so updated) – Luca Detomi Oct 20 '15 at 13:09
  • It is Team Foundation Server we are using. I've used git in the past and I was hoping TFS had an ignore file, but I cannot right-click and choose to exclude the Site.css as per other files. – VictorySaber Oct 20 '15 at 13:30

2 Answers2

1

Git has .gitignore to prevent watching for edits in Site.css.

If you're using Team Foundation Server, please, see this old similar question. Accepted answer is another one, but in my opinion this is answer you're looking for.

In short:

  1. File -> Source Control -> Advanced
  2. Select "Exclude < filename > from Source Control"

Look at the link to further details.

Community
  • 1
  • 1
Luca Detomi
  • 5,564
  • 7
  • 52
  • 77
1

Team Foundation Server version control (TFVC) supports a .tfignore file if you're using local workspaces. See MSDN for more information on the format of .tfignore

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • Thanks. i can create this file, add it to source control and when the team member does a Get Latest, they'll have it. – VictorySaber Oct 23 '15 at 08:09