Action disabled: index
オープンソースの販売サイト構築ソフト EC-CUBE についてのメモ。

Git 管理 (個別サイトのカスタマイズ用途)

冒頭3行の記述は通常は不要かも。不要ディレクトリが多いケースに向けて https://webplus8.com/gitignore-permit-special-directory/ を参考とした対応した。Git 2.18.5 で意図した動作となった。しかし、/.gitignore が対象となり不都合だったので、末尾に / を追加した。

.gitignore
/*/
!/data/
!/html/
/data/Smarty/templates/*/_packages/
/data/Smarty/templates_c/
/data/cache/ #個別に検討
/data/download/
/data/downloads/backup/
/data/downloads/tmp/
/data/logs/
/data/upload/
/html/install/temp/
/html/upload/
*.tar
*.tar.*
*.tgz
*.zip
Thumbs.db
/data/downloads/KEN_ALL.CSV
/data/downloads/KEN_ALL_utf-8.CSV
/data/fonts/wlmaru20044.ttf

html/ 下に管理対象外のコンテンツを大量に含む場合、/html/… の部分を下のように置換する。

  • バージョンにより、!… で列挙が必要なディレクトリは、若干異なるかも。
/html/*/
!/html/abouts/
!/html/admin/
!/html/api/
!/html/cart/
!/html/contact/
!/html/entry/
!/html/forgot/
!/html/frontparts/
!/html/guide/
!/html/install/
!/html/js/
!/html/mypage/
!/html/order/
!/html/plugin/
!/html/preview/
!/html/products/
!/html/regist/
!/html/rss/
!/html/shopping/
!/html/unsupported/
!/html/upgrade/
!/html/user_data/

主要ファイル種別のみ管理する (画像は管理外)

  • JavaScript ライブラリーの一部としての画像は管理に含める。
.gitignore
# 拡張子の無いファイルを除外
*
!*/
 
# 特定拡張子のみ追跡する
*.*
!*.php
!*.tpl
!*.js
!*.css
!*.sh
!.htaccess
 
# 拡張子限定を行わない (Git 1.8.2以降)
!/data/module/**/*
!/**/js/**/*
 
# 無視ディレクトリー
/html/install/temp/
/data/Smarty/templates_c/
/data/downloads/tmp/
/data/cache/
/data/config/
/test/
/tests/

【注意】 2.7.0 のみで有効な記述例

.gitignore
*
!/data/
!/html/
/data/Smarty/templates_c/
/data/cache/
/data/config/
/data/downloads/tmp/
/data/logs/
!*.css
!*.js
!*.php
!*.tpl
tips213/git.txt · 最終更新: 2024/05/24 20:15 by seasoft
© 2008-2025 Seasoft.