简体   繁体   English

如何去掉visual studio code中git的变化?

[英]How to remove the changes of git in visual studio code?

在此处输入图像描述

Each time I open the visual studio code, it will load tons of changes that is unfamiliar to me.每次我打开 visual studio 代码时,它都会加载大量我不熟悉的更改。 I want to disable or remove the changes that I circled in the left panel of the above screenshot.我想禁用或删除我在上面屏幕截图的左侧面板中圈出的更改。

I am new to git and github. I have search many solution but none of them are work.我是 git 和 github 的新手。我搜索了很多解决方案,但没有一个有效。 Is their any method to remove the unwanted changes at the left panel of the visual studio code?他们是否有任何方法可以删除 visual studio 代码左侧面板中不需要的更改?

open the prompt from the project folder and type: 从项目文件夹中打开提示,然后键入:
git merge git合并

You have to edit (or create) your .gitignore file, located at the same level as your .git folder. 您必须编辑(或创建).gitignore文件,该文件与.git文件夹位于同一级别。 Once commited, files/folders listed will not be included in stageable changesfor next commits. 提交后,列出的文件/文件夹将不包含在下次提交的可分级更改中。

Note that wildcards are allowed (example : *.pdf will ignore all pdf files) 请注意,允许使用通配符(例如:* .pdf将忽略所有pdf文件)

Mainly, you have to point folders where build produce files. 主要是,您必须将文件夹指向用于生成文件的文件夹。

.gitignore manual Usefull .gitignore templates .gitignore手册 有用的.gitignore模板

Note: It will take some time to remove 10k+ changes

step 1: Go To Source Control then Select All the folders.步骤 1:转到Source Control然后选择所有文件夹。

step 2: Right-click the mouse and select add to .gitignore then wait for some time.第二步:鼠标右击选择add to .gitignore然后等待一段时间。

在此处输入图片说明 Then:然后: 在此处输入图片说明

You may need to manually do add to .gitignore for some files.对于某些文件,您可能需要手动add to .gitignore

Create a new file named .gitignore (If not available) at the root of the git repository.在 git 存储库的根目录创建一个名为.gitignore (如果不可用)的新文件。 Then type ' node_modules ' on that .gitignore file and save the file.然后在该.gitignore文件上键入“ node_modules ”并保存文件。 This action will prevent adding the files of node modules to git.此操作将阻止将节点模块的文件添加到 git。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM