django - 无法忽略 Django 项目中推送到 git 的静态文件

标签 django git

我已将一个新的 Django 项目 BTRE 推送到我的 git 存储库。但我无法忽略推送到存储库的静态文件,即使我已经提到了 .gitignore 文件中的目录。

-BTRE_Project
|-btre
   |-static

这是我的 .gitignore 文件:

# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
# in your Git repository. Update and uncomment the following line accordingly.

btre/static/

我尝试删除存储库并在更新 .gitignore 文件后再次推送。

最佳答案

如果您想忽略静态文件夹及其中的所有文件,请将其放入 .gitignore 文件中。

static/

这将忽略静态目录和其中的文件。

关于django - 无法忽略 Django 项目中推送到 git 的静态文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66421377/

相关文章:

django - Django 中的多个数据库

python - 如何动态地将 Docker 容器的 IP 添加到 Django ALLOWED_HOSTS

django.db.utils.OperationalError : cannot ALTER TABLE "forum_thread" because it has pending trigger events

git - 在远程机器上没有git的Git克隆

尝试克隆 TensorFlow 存储库时 git clone 不起作用

Django - 如何在微服务架构中实现认证服务

python - Django 检索 S3 存储桶中的文件列表

java - 在 Java 应用程序中包含 GIT 安装

java - 微服务项目中的 Maven 传递依赖

node.js - 无法运行 bower.json 文件 - 来自 NPM 命令