Search code examples
gittfsvisual-studio-2017

Unable to add a file in repository with minus red sign. Visual Studio 17/TFS/Git


I am using Visual studio 17.

I have created a new file which is out of solution but is still in the repository of git.

I am unable to see this new file in my changes hence I can't check it in.

When I navigate through directory view, it show me the file that I have added but it has a red minus sign with it. Right clicking this file doesn't give me any option to add it to the repository. I want this file in my pending changes.

enter image description here

What can I do to make it part of my pending changes?


Solution

  • What can I do to make it part of my pending changes?

    Just like Philippe and EncryptedWatermelon said, the red minus icon in source control is generally used to indicate that the file is ignored.

    To make it part of your pending changes, there is an option Add Ignored File to Source Control... when you right lick on this file:

    enter image description here

    After add this file to source control, we could see it in the pending changes, or you can check your .gitignore file, and move this file from that file.

    Hope this helps.