[課題]
PyCharmのプロジェクトをGitHubにアップするのに.gitignoreをどう設定すればよいか。
[結論]
.idea/
venv/
▼個人のお勉強用ならこれでオッケー。
それを言い出したら「.gitignoreは設定せんでもええんとちゃう」って話にもなりかねないが。
「.idea/」については「github/gitignore」では以下のように言われている:
"For a more nuclear option (not recommended) you can uncomment the following to ignore the entire idea folder."
https://github.com/github/gitignore/blob/main/Python.gitignore
▼pipで設定ファイル(requirements.txt)を使って一括インストールする方法がある。
pip freeze > requirements.txt
pip install -r requirements.txt
[参考]
▼github/gitignore: A collection of useful .gitignore templates
https://github.com/github/gitignore
▼より良い .gitignore を一瞬で手に入れる - A Memorandum
https://blog1.mammb.com/entry/2020/01/25/090000
▼Google検索: 「pycharm git 無視すべきファイル」
https://www.google.com/search?q=pycharm+git+%E7%84%A1%E8%A6%96%E3%81%99%E3%81%B9%E3%81%8D%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB
▼Google検索: 「python requirements.txt とは」
https://www.google.com/search?q=python+requirements.txt+%E3%81%A8%E3%81%AF