1

Scenario: In my launchSettings I specify "launchBrowser": true, In my colleague's he prefers "launchBrowser": false,

I've tried adding the following to gitIgnore but they always appear as a "change" (in VS2019)

launchSettings.json
**/Properties/launchSettings.json

enter image description here

Sniipe
  • 1,116
  • 3
  • 13
  • 28
  • 1
    Based on the description, I'm not sure that the thing you want to do is ignore lines, but in that case: https://stackoverflow.com/questions/16244969/how-to-tell-git-to-ignore-individual-lines-i-e-gitignore-for-specific-lines-of – gorhawk Apr 29 '20 at 12:03
  • 3
    You cannot ignore a committed file (technically, a *tracked* file). You *can* tell Git to stop looking at your work-tree copy, using `git update-index --skip-worktree`, but technically that's abusing the sparse-checkout code. – torek Apr 29 '20 at 12:40
  • @torek, thanks for the comment. I'm not sure what other files it would stop looking at if I was to add that line. I might just work around the problem. – Sniipe Apr 29 '20 at 15:17
  • @gorhawk, sorry I was only pointing out a line in the launchSettings file that I was trying to keep different on each of our environments. I don't think there is such a thing as local launchSettings... – Sniipe Apr 29 '20 at 15:19

1 Answers1

1

Kind of a crappy way to do it, but you can add the filename to .gitignore, cut the file to another directory, commit the .gitignore and file deletion change, then bring your settings file back.

Deep Shah
  • 44
  • 8