From 7be51790e493a9836095705bcbb29ff9687d77c4 Mon Sep 17 00:00:00 2001 From: daegontaven Date: Fri, 11 Aug 2017 01:46:24 -0400 Subject: [PATCH 1/2] Add version control ignores to gotchas --- docs/writing/gotchas.rst | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/writing/gotchas.rst b/docs/writing/gotchas.rst index fcf143943..4c901d0ae 100644 --- a/docs/writing/gotchas.rst +++ b/docs/writing/gotchas.rst @@ -230,13 +230,27 @@ Here's nice trick for removing all of these files, if they already exist:: Run that from the root directory of your project, and all ``.pyc`` files will suddenly vanish. Much better. +Version Control Ignores +~~~~~~~~~~~~~~~~~~~~~~~ +If you still need the ``.pyc`` files for performance reasons, you can always add them +to the ignore files of your version control repositories. Popular version control +systems have the ability to use wildcards defined in a file to apply special +rules. +An ignore file will make sure the matching files don't get checked into the repository. +Git_ uses ``.gitignore`` while Mercurial_ uses ``.hgignore``. +.. _Git: https://git-scm.com/ +.. _Mercurial: https://www.mercurial-scm.org/ +At the minimum your ignore files should looks like this. +:: + syntax:glob # This line is not needed for .gitignore files. + *.py[cod] # Will match .pyc, .pyo and .pyd files. + __pycache__/ # Exclude the whole folder - - - +You may wish to include more files and directories depending on your needs. +The next time you commit to the repository, these files will not be included. From ec5f791c695a5c205069f9c6c0fde6fe5e921ccd Mon Sep 17 00:00:00 2001 From: Vivek Joshy Date: Fri, 11 Aug 2017 06:01:03 -0400 Subject: [PATCH 2/2] Correct typo Change looks to look --- docs/writing/gotchas.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/gotchas.rst b/docs/writing/gotchas.rst index 4c901d0ae..4a28085b3 100644 --- a/docs/writing/gotchas.rst +++ b/docs/writing/gotchas.rst @@ -244,7 +244,7 @@ Git_ uses ``.gitignore`` while Mercurial_ uses ``.hgignore``. .. _Git: https://git-scm.com/ .. _Mercurial: https://www.mercurial-scm.org/ -At the minimum your ignore files should looks like this. +At the minimum your ignore files should look like this. ::