概要
githubでリポジトリを作る際にConfigurationの欄の
Add .gitignore のWordPressを選択する
プルダウンを選択しリポジトリを作成すると .gitignoreがデフォルトで出来た状況のリポジトリが出来上がる。
内容を確認すると以下
.gitignore
# Wordpress - ignore core, configuration, examples, uploads and logs.
# https://github.com/github/gitignore/blob/main/WordPress.gitignore
# Core
#
# Note: if you want to stage/commit WP core files
# you can delete this whole section/until Configuration.
/wp-admin/
/wp-content/index.php
/wp-content/languages
/wp-content/plugins/index.php
/wp-content/themes/index.php
/wp-includes/
/index.php
/license.txt
/readme.html
/wp-*.php
/xmlrpc.php
【以下略】
・
・
・
あらかじめカスタムしないディレクトリ等を含めないようにしてくれている。
プラグインやthemeのインストールも不要の場合は要追記。
あとはローカルで開発するディレクトリで
$ git clone hogefuga_repo .
ドットを付けてディレクトリコピーしないようにしてローカルで作業を進める。
コラボレーションツールデフォルトのgitを使っていたのでgithubの至れり尽くせりをここに来て強く感じるようになった。便利な物は積極的に使っていく。