git忽略使用GCloud的gcloudignore时不忽略文件

问题描述 投票:2回答:1

[我有一条规则可以忽略secret.py(在我的情况下为production.py),一旦我添加了.gcloudignore,github就会停止遵循该规则...在我不知道的gitignore和gcloudignore之间是否存在某种替代的规则?

my-project/
    .git
    .gitignore
    my-project/
        .gcloudignore
        settings/
            base.py
            local.py
            production.py

我的.gitignore:

my-project/my-project/settings/production.py
my-project/my-project/settings/local.py

我的.gcloudignore:

# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
#   $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

*.sqlite3
settings/local.py

最终结果是'local.py'没有被推送到Google Cloud NOR github。但是,'production.py'被推送到github和gcloud。

python gcloud gitignore gcloudignore
1个回答
0
投票

看起来您正在强制忽略以前应用的规则。

尽管请确保通过]启用cloudignore>

gcloud config set gcloudignore/enabled true

并确保将.gcloudignore->放置在项目的根目录中/基本上是.git .gitignore所在的位置。

© www.soinside.com 2019 - 2024. All rights reserved.