File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -230,13 +230,27 @@ Here's nice trick for removing all of these files, if they already exist::
230230Run that from the root directory of your project, and all ``.pyc `` files
231231will suddenly vanish. Much better.
232232
233+ Version Control Ignores
234+ ~~~~~~~~~~~~~~~~~~~~~~~
233235
236+ If you still need the ``.pyc `` files for performance reasons, you can always add them
237+ to the ignore files of your version control repositories. Popular version control
238+ systems have the ability to use wildcards defined in a file to apply special
239+ rules.
234240
241+ An ignore file will make sure the matching files don't get checked into the repository.
242+ Git _ uses ``.gitignore `` while Mercurial _ uses ``.hgignore ``.
235243
244+ .. _Git : https://git-scm.com/
245+ .. _Mercurial : https://www.mercurial-scm.org/
236246
247+ At the minimum your ignore files should look like this.
237248
249+ ::
238250
251+ syntax:glob # This line is not needed for .gitignore files.
252+ *.py[cod] # Will match .pyc, .pyo and .pyd files.
253+ __pycache__/ # Exclude the whole folder
239254
240-
241-
242-
255+ You may wish to include more files and directories depending on your needs.
256+ The next time you commit to the repository, these files will not be included.
You can’t perform that action at this time.
0 commit comments