1$ echo debug.log >> .gitignore
2$ git rm --cached debug.log
3rm 'debug.log'
4$ git commit -m "Start ignoring debug.log"
5
1// Example of .gitignore file
2.env
3config.json
4node_modules
5// A .gitignore file is supposed to ignore any files when commiting to github with git
1# Byte-compiled / optimized / DLL files
2__pycache__/
3*.py[cod]
4*$py.class
5
6# C extensions
7*.so
8
9# Distribution / packaging
10.Python
11build/
12develop-eggs/
13dist/
14downloads/
15eggs/
16.eggs/
17lib/
18lib64/
19parts/
20sdist/
21var/
22wheels/
23share/python-wheels/
24*.egg-info/
25.installed.cfg
26*.egg
27MANIFEST
28
29# PyInstaller
30# Usually these files are written by a python script from a template
31# before PyInstaller builds the exe, so as to inject date/other infos into it.
32*.manifest
33*.spec
34
35# Installer logs
36pip-log.txt
37pip-delete-this-directory.txt
38
39# Unit test / coverage reports
40htmlcov/
41.tox/
42.nox/
43.coverage
44.coverage.*
45.cache
46nosetests.xml
47coverage.xml
48*.cover
49*.py,cover
50.hypothesis/
51.pytest_cache/
52cover/
53
54# Translations
55*.mo
56*.pot
57
58# Django stuff:
59*.log
60local_settings.py
61db.sqlite3
62db.sqlite3-journal
63
64# Flask stuff:
65instance/
66.webassets-cache
67
68# Scrapy stuff:
69.scrapy
70
71# Sphinx documentation
72docs/_build/
73
74# PyBuilder
75.pybuilder/
76target/
77
78# Jupyter Notebook
79.ipynb_checkpoints
80
81# IPython
82profile_default/
83ipython_config.py
84
85# pyenv
86# For a library or package, you might want to ignore these files since the code is
87# intended to run in multiple environments; otherwise, check them in:
88# .python-version
89
90# pipenv
91# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92# However, in case of collaboration, if having platform-specific dependencies or dependencies
93# having no cross-platform support, pipenv may install dependencies that don't work, or not
94# install all needed dependencies.
95#Pipfile.lock
96
97# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98__pypackages__/
99
100# Celery stuff
101celerybeat-schedule
102celerybeat.pid
103
104# SageMath parsed files
105*.sage.py
106
107# Environments
108.env
109.venv
110env/
111venv/
112ENV/
113env.bak/
114venv.bak/
115
116# Spyder project settings
117.spyderproject
118.spyproject
119
120# Rope project settings
121.ropeproject
122
123# mkdocs documentation
124/site
125
126# mypy
127.mypy_cache/
128.dmypy.json
129dmypy.json
130
131# Pyre type checker
132.pyre/
133
134# pytype static type analyzer
135.pytype/
136
137# Cython debug symbols
138cython_debug/