Visual Studio 2017 15.3.0 git changes include “storage.ide” even though .vs/ in .gitignore

前端 未结 5 1536
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 09:04

I upgraded VS 2017 to 15.3.0 a few days ago. Since then file \"storage.ide\" has remained in my modified files, even through I have used a suggested .gitignore for VS, which inc

相关标签:
5条回答
  • 2021-01-30 09:32

    the following seems to have solved the issue for me.

    # Visual Studio 2015/2017 cache/options directory
    *.vs/
    

    it ignores everything in it.

    0 讨论(0)
  • 2021-01-30 09:32

    I just had the same issue. I solved it by making a whole new .gitignore file from visual studio's team explorer (Team Explorer => Some git directory => Settings => Repository Settings => Gitignore file Add).

    Then I deleted my .vs in my project folder and manually committed by git bash with the following lines:

    git add *.*
    git commit -m "Removing some files"
    git push origin master
    
    0 讨论(0)
  • 2021-01-30 09:41

    To fix this, if you got to the Team Explorer tab and click on the Manage Connections button (the green one a the top) you will see a list of local Git Repositories.

    Right click on the repository you want to stop tracking the storage.ide file on and select Open Command Prompt.

    You should then be able to type the following:

    git rm --cached -r .vs
    

    This removes the .vs folder and its contents and subdirectories from being tracked in git.

    0 讨论(0)
  • 2021-01-30 09:46

    This probably means it was incorrectly added to the git repository at some point and then ignored afterwards. git will continue to track changes to gitignored files if they are present in the index ("checked in").

    If you don't want the file checked in at all, you can remove it from the index by running

    git rm path/to-file --cached
    

    This will keep the contents on disk, if you don't want the file to exist at all you can run

    git rm path/to-file --force
    

    Note that this may be undesirable if (for instance) the base project files are intended to be checked in as a starting point for working on the project. And you may just have to be careful about not committing that specific file.

    0 讨论(0)
  • 2021-01-30 09:55

    I'm using SourceTree(https://www.sourcetreeapp.com/) to manage my git commits. With it you can right click your changes and have an option of Stop Tracking.I used it for the same files you are trying to ignore as myself also just upgraded to 15.3.0 and that was the last time i saw those pending changes

    0 讨论(0)
提交回复
热议问题