尝试通过在Visual Studio 2017的.git-ignore文件中添加slnx.sqlite文件来撤消/忽略,但仍然显示未提交. [英] Trying to undo/ignore by adding slnx.sqlite file in .git-ignore file in visual studio 2017,But still it shows uncommitted.

查看:195
本文介绍了尝试通过在Visual Studio 2017的.git-ignore文件中添加slnx.sqlite文件来撤消/忽略,但仍然显示未提交.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我正在Visual Studio中的一个项目上工作,并且正在尝试提交更改,因此我已经在.gitignore文件中添加了我不想提交的文件.以及我在.gitignore文件中添加了/.vs/slnx.sqlite,但仍显示为未提交的文件.我必须要做的.请帮助我解决这个问题

as am working on a project in visual studio and am trying to commit the changes and i have added the files in the .gitignore which i do not want to commit them. as well as i have added /.vs/slnx.sqlite in the .gitignore file but still it is showing as an uncommitted file. what i have to do. Please help me with this problem

    `/.vs/angular2-research/v15
    /.vs/config/applicationhost.config
    /.vs/slnx.sqlite
    /.vs/slnx.sqlite-journal
    /cleanui/cleanui-admin-template-angular/node_modules
    /cleanui/.vs
    /.vs
    slnx.sqlite
    *.sqlite
    /.vs/*.sqlite
    .vs/*.sqlite` 

推荐答案

它显示为未提交?如果是这种情况,则将其添加到.gitignore不会有任何变化,因为.gitignore仅适用于未跟踪的文件(到目前为止尚未跟踪git的文件....如果已提交该文件以前的修订版(因此是HEAD的一部分),然后.gitignore不变)....因此,应遵循两种方法:

it's showing up as uncommitted? If that's the case then adding it to .gitignore changes nothing because .gitignore only works for untracked files (files that git hasn't been tracking so far.... if a file has already been committed on a previous revision [and therefore is part of HEAD] then .gitignore changes nothing).... so, two approaches are to be followed:

  • 将文件保留在项目上,但明确要求git 关心文件是否更改.然后,您可以执行 git update-index-假定未更改的某些文件

  • Keep the file on the project but specifically ask git to not care if it changes. Then you can do git update-index --assume-unchanged somefile

从分支的历史记录中删除文件.这是完全不同的工作,需要重写分支(或多个分支)的历史记录

Remove the file from the history of the branch. This is quite a different endeavor and requires rewriting the history of the branch (or branches) Completely remove file from all Git repository commit history

这篇关于尝试通过在Visual Studio 2017的.git-ignore文件中添加slnx.sqlite文件来撤消/忽略,但仍然显示未提交.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆