1

ローカル ファイルを Amazon Web サービスにアップロードするために git を使用していますが、次の問題が発生しています。

フォルダー (images/members) を gitinore ファイルに追加しましたが、git push を実行すると AWS で削除されます。アプリケーションがその下に動的フォルダーを作成するため、images/members フォルダーの下のファイルとサブフォルダーを無視したいだけです。

私がしたステップ:

1) Web ルートにある .gitignore ファイルに次の行を追加しました。

画像/メンバー/

2) git 初期化

3) git を追加します。

4) git commit -m "テスト"

5) git aws.push

すべての変更は公開されますが、フォルダーメンバーは公開されますが、アプリケーションのメンバーが images/members の下にフォルダーを作成すると、別の git aws.push を実行すると削除されます。フォルダーを削除せずに無視したいだけです。

ありがとう

4

1 に答える 1

0

git がすでにこれらのファイルを追跡している場合は、git rmそれらを追跡してから追加し直す必要があります。

グローバルまたはそのディレクトリ内の別の .gitignore が設定をオーバーライドしている可能性があります。優先順位については、man ページのエントリを参照してください。

order of precedence, from highest to lowest (within one level of precedence, the last matching pattern decides the outcome): Patterns read from the command line for those commands that support them.

   o   Patterns read from a .gitignore file in the same directory as the path, or in any
       parent directory, with patterns in the higher level files (up to the toplevel of the
       work tree) being overridden by those in lower level files down to the directory
       containing the file. These patterns match relative to the location of the .gitignore
       file. A project normally includes such .gitignore files in its repository, containing
       patterns for files generated as part of the project build.

   o   Patterns read from $GIT_DIR/info/exclude.

   o   Patterns read from the file specified by the configuration variable core.excludesfile
于 2012-11-16T18:12:33.003 に答える