\r\n\r\n
この記事では、commit-m オプションを使って 1 行の git commit メッセージを書くのではなく、適切な commit メッセージを書く方法を学びます。適切なコミットメッセージは、あなたが何を変更したかを正確に他の人が見ることができ、あなたのプロジェクトが他の人からより見えるようにし、その結果、オープンソースコミュニティへの露出を増やすのに役立つので、重要である。
コミットメッセージはターミナルコマンドに含めず、空白のファイルを開いてください。メッセージは次のような形式でなければなりません。
投稿メッセージの例を以下に示します。
Added Docker support, new is_unique feature, plus bug fix.Added support for docker-compose and updated installation instruction as necessary. Also included a new feature within check_order() function to check for uniqueness, and fixed **all bug when creating product slugs.src/somedir/library.py:381 -- Added 'is_unique' parameter to the check_order() function.src/products.py:194 -- Fixed bug when creating product slug.docker-compose.yml -- Added docker-compose file.docs/install.md -- Updated installation guide to include how to install via Docker.コミットするとき、-mメッセージの代わりに-fileオプションを使うようにしました。例えば、コミットメッセージのファイル名がcommit.txtの場合、以下のようなコマンドを実行することができます。
git commit --file commit.txt以上です。これにより、より標準化された明確な投稿メッセージをフォロワーに提供し、プロジェクトの露出を高め、オープンソースコミュニティの発展に貢献できることを期待しています。
Photo credit: Caleb White/Unsplash