0

IDE: Visual Studio Community 2019 SO: Windows 10

I found this extension for vscode: https://marketplace.visualstudio.com/items?itemName=npxms.hide-gitignored

And I want do this in visual studio.

I run this command in cmd: git rm -r --cached . && git add . && git commit -am "Remove ignored files"

Worked temporally, after build solution the new files are there again.

.gitignore file and screen of visual studio I want change

If anyone can help I will appreciate.

[EDIT]: I want not see .gitignored files in git changes tab. Git is already ignore these files, when make pull or push these files not go to devop's repository or not get from there. But still showed at git changes tab.

  • 1
    This isn't related to Visual Studio. The issue you have is that some of your ignored files are being tracked (maybe because they were committed before your .gitignore file ignored them). It looks like you found a possible fix for that, as [documented here](https://stackoverflow.com/a/19095988/184546). So your question ought to be, why, after doing that, are the files still being tracked? My first guess would be that the commit "Remove ignored files" is not on your current branch. – TTT Jul 01 '21 at 14:46
  • BTW, [this file](https://github.com/github/gitignore/blob/master/VisualStudio.gitignore) is usually a pretty good place to start for a Visual Studio .gitignore file. – TTT Jul 01 '21 at 14:55
  • Hi @TTT, many thanks for your reply. I got this command from topic link you share. I tried many things. I only ask for help after give up one problem. It is my third question here. I tried unistall GIT SCM many times and Visual Studio Git for Windows, both and all combinations, never worked fine. I have commited the .gitignore before (commited and pushed) it's not the problem. After I run the command worked fine, but after compile solution the files appear again in solution explorer. – Gabriel Plata Jul 01 '21 at 20:36
  • GitIgnore file is working, because all file added there are ignored when commit/pull/push. But see all that files in explorer is very boring... – Gabriel Plata Jul 01 '21 at 20:36
  • about your blob .gitignore file, many thanks, don't need. even I need it I won't download the file, if need one day I will search and copy text, not download file. but thanks. – Gabriel Plata Jul 01 '21 at 20:38
  • Re: the link to the .gitignore file, I'm not sure what you meant by downloading, since it's just text. But if you click on "Raw" you can see that actual file which may be easier to copy and paste. I'll address your other comment shortly. – TTT Jul 01 '21 at 20:43
  • I may be misunderstanding the word "explorer". Let's use the word "tab" and it might be clearer. There are two different tabs. The one in your screenshot is the "Git Changes" tab. If your files are properly ignored, then those files in the bin and obj directories should not appear there. In your screenshot you can see they have an "A" for add or "M" for modify which means they are not being ignored, as if your .gitignore isn't working the way you intended. There is another tab, called "Solution Explorer" with a button you can toggle to "Show All Files" which shows all, even ignored files. – TTT Jul 01 '21 at 20:53
  • The files added to .gitignore are working, because when I do pull/push and not commit these files git not warning and block me to do pull or push. Yeah at tab bro, sorry sad explorer, my english is not so god. I do not want see ignored files at tab in visual studio. Others files they are not in .gitignore if I not commit and try pull/push git warning and block me to do that. I don't like that too. But not know if is possible change that, if can be done I want do that too. – Gabriel Plata Jul 02 '21 at 12:22
  • And sorry for sad that about your .gitignore file. if have raw I can't never write that coment, many sorry. – Gabriel Plata Jul 02 '21 at 12:23
  • @TTT wow bro. many thanks for your .gitignore file. I will suggest for my chief of development. and sorry again for that comment, I did not saw before it's a github link. sorry. – Gabriel Plata Jul 02 '21 at 12:29
  • hi @TTT I have only branch: master, we have only one branch. I edited the question to be more clear. – Gabriel Plata Jul 02 '21 at 23:37

0 Answers0