标签: gitignore

如何 gitignore Word 文档?

例如,我results.docx在目录中有一个标题为 的 Word 文档research。我如何从research目录中 gitignore 这个 word 文档?

git gitignore

2
推荐指数
1
解决办法
2278
查看次数

Git 不会删除忽略目录中的 git 存储库

我有一个.gitignore包含该target目录的文件。现在我意识到 git git 不会删除目录中的 git 存储库,target即使我这样做:

$ git clean -fdx
Skipping repository target/x
Run Code Online (Sandbox Code Playgroud)

有没有解决方案来处理这个问题?特殊配置选项?因为我已经给予了-f力量等?

更新:

我可以target通过以下手动步骤在目录中手动创建存储库:

maven-it-extension (issue-21)$ git st
On branch issue-21
Your branch is up to date with 'origin/issue-21'.

nothing to commit, working tree clean
maven-it-extension (issue-21)$ mkdir target/x
mkdir: target: No such file or directory
maven-it-extension (issue-21)$ mkdir -p target/x
maven-it-extension (issue-21)$ cd target/x/
x (issue-21)$ git init .
Initialized empty Git repository in /Users/khmarbaise/ws-git-apache/maven-it-extension/target/x/.git/
x (master …
Run Code Online (Sandbox Code Playgroud)

git gitignore

2
推荐指数
1
解决办法
654
查看次数

如何忽略 json 文件?

我将 api 密钥保存在 json 文件中。该 json 文件位于主文件夹中。我不想将此密钥文件提交到 github。我应该在 gitignore 文件中添加什么?

我的项目文件如下..

在此输入图像描述

git github gitignore react-native

2
推荐指数
1
解决办法
1万
查看次数

在供应商 vscode 中找不到函数的定义

我的 vscode 没有看到供应商库中函数的定义。
我不知道它是否与 gitignore 有什么关系,我把供应商放在哪里,但我想找到一个解决方案,让我将它保存在 gitignore 中,但允许我在工作环境中进行搜索。
因为它没有看到定义,所以它被强调为一个问题,我无法深入了解我在这里工作的内容。它不会影响结果,这是使用 vscode 时的问题。你能帮忙吗?

我尝试在项目根文件夹 .vscode 中创建 config.json 并说:

{
    "search.useIgnoreFiles": false
}
Run Code Online (Sandbox Code Playgroud)

它没有做任何事情。感谢您的调查。

php configuration gitignore visual-studio-code

2
推荐指数
1
解决办法
2166
查看次数

Flutter:gitignore 被...忽略

我的根文件夹中有一个gitignore,位于 lib、ios、android、build... 文件夹旁边。

在它里面我有一堆被忽略的文件夹,其中一个是build/但每次我做一些更改时,这个文件夹都会再次出现:

修改:build/ios/iphonesimulator/Runner.app/Frameworks/GTMAppAuth.framework/GTMAppAuth 修改:build/ios/iphonesimulator/Runner.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher

我想这与 Flutter 无关,它只是 Git,但这只发生在我的 Flutter 项目中,而不是其他项目中

git gitignore flutter

2
推荐指数
1
解决办法
2841
查看次数

.gitignore 上要忽略的 Docker 文件

我是码头工人的新手。我已经完成了我的 Django 项目的 docker 化。.gitginore在将更改推送到项目之前,我应该添加哪些文件和/或文件夹?或者不应该添加任何文件?我不是在谈论我的.dockerignore文件。

django gitignore docker

2
推荐指数
1
解决办法
1万
查看次数

Gitignore 不忽略文件

由于某些原因 gitignore 正在工作,我创建了一个新文件夹并初始化了 git init 创建了一个 .gitignore 文件并添加了一些要忽略的文件,但它并没有忽略我是否遗漏了一些东西?

在此之前,我在上一个仓库中仍然面临这个问题,当时我尝试了一些解决方案,包括

git rm --cached filename
Run Code Online (Sandbox Code Playgroud)

因为当时这些文件位于远程存储库上--cached rm,但在此之后仍然无法工作,为了确定是否存在任何错误,我创建了一个新项目,但它仍然发生,它并没有忽略这些文件

这是整个文件夹的快照,甚至 vscode 也显示文件已更新

在此输入图像描述

另外, .git/info/exclude 有效,但如果文件位于子目录中则不起作用

git gitignore

2
推荐指数
1
解决办法
2629
查看次数

如何忽略 git 中的 .env 文件?

我在 .env 文件中进行了更改,然后在终端中写入git status

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   .env
Run Code Online (Sandbox Code Playgroud)

我希望 .env 文件中的更改被 git 忽略,所以我在 .gitignore 中添加了这一行:

/.env
Run Code Online (Sandbox Code Playgroud)

现在当我写的时候git status我得到的结果是:

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   .env
    modified:   .gitignore
Run Code Online (Sandbox Code Playgroud)

我现在能做什么?为什么 gitignore 没有被忽略?

git gitignore

2
推荐指数
1
解决办法
3501
查看次数

Git ignore - 你如何覆盖ignore-all的异常?

我想创建一个我的bash设置和插件以及诸如此类的git repo.我忽略了所有内容(第0行),然后在repo中手动添加了我想要的文件/文件夹.(我必须这样做,因为repo在我的~文件夹中.)我想忽略.vim/colors /目录中的所有颜色配置文件,但我确实想要包含我正在使用的一个文件(apprentice.vim) ).

.vim/colors/*行似乎不起作用 - 它根本不会忽略任何文件.使用!!.vim/colors/*也不起作用.我怎么能让它覆盖所有以前的规则并忽略colors文件夹,然后仍然允许apprentice.vim文件被忽略?

/*

*.swp

!.gitignore

!.bashrc
!.bash_profile

!.vimrc
!.vim
.vim/colors/* # Don't include all of the other color schemes
!.vim/colors/apprentice.vim
Run Code Online (Sandbox Code Playgroud)

git gitignore

1
推荐指数
1
解决办法
1457
查看次数

是否忽略子文件夹(包含所有内容)之外的所有内容?

我想忽略除特定子文件夹(及其所有内容!)以外的所有内容。我尝试了可能出现的重复问题的解决方案,但没有成功。

我需要一些简单的东西,例如:

*
!That/Very/Folder/*
Run Code Online (Sandbox Code Playgroud)

但这不起作用

git gitignore

1
推荐指数
2
解决办法
1775
查看次数