git 如何在 SmartGit 中忽略文件/文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30271324/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:00:30  来源:igfitidea点击:

How to ignore file/folder in SmartGit

gitsmartgit

提问by user3418135

I'm using SmartGit. I want to ignore a folder in repository. When I right-click folder, option "Ignore" is grayed out and I can't click it.

我正在使用 SmartGit。我想忽略存储库中的文件夹。当我右键单击文件夹时,选项“忽略”呈灰色,我无法单击它。

回答by VonC

You would need to make sure this folder content isn't versioned first.

您需要先确保此文件夹内容没有版本化。

In command line, try a git rm --cached -r yourFolder/

在命令行中,尝试一个 git rm --cached -r yourFolder/

Then check if the ignore option is now available.

然后检查忽略选项现在是否可用。

The other reason would be because that folder is empty. since Git doesn't track empty folder, maybe SmartGit doesn't allow to ignore it.

另一个原因是因为该文件夹是空的。由于 Git 不跟踪空文件夹,因此 SmartGit 可能不允许忽略它。

回答by Erkki Laaneoks

Open: Local => "Edit Ignore File..." => "Exclude File" => Edit Add directory name at new line. For example ".metadata" => Save Done :)

打开:本地 => "编辑忽略文件..." => "排除文件" => 在新行编辑添加目录名称。例如“.metadata”=>保存完成:)

回答by Luis Miguel Carrasco Bereciart

option 1: Right click on the file to ignore -> ignore

选项 1:右键单击要忽略的文件 -> 忽略

option 2: enter the .git / info folder and modify the exclude file.

选项2:进入.git/info文件夹,修改排除文件。