I've researched this and I can't seem to bump on a working solution. I have a repo locally and want to ignore everything in it except two files, since those are the only ones necessary to build the program.
What I've tried is this:
Contents of .gitignore:
# Ignore everything
*
# not these files...
!.gitignore
!ApiTest/KLM_Service.cs
!ApiTest/Program.cs
The structure of my repo is this:
.git
ApiTest
bin
obj
Properties
App.config
KLM_Service.cs
Program.cs
.gitignore
I'm on Windows using GIT Bash.
Any ideas on how to solve this?