PyCharm 2018.3 Help

Configuring Version Control Options

Configuring General VCS Settings

General version control settings apply to all version control systems integrated with PyCharm. General settings are specified on the Version Control page of the Settings dialog box, and include defining actions that require confirmation, background operations, ignored files, issue navigation, and depth of history.

To configure general version control settings

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), click Version Control. The Version Control page opens.

  2. Specify which version control related actions should require confirmation.

  3. Specify which operations should be performed in the background.

  4. Create a list of files to be ignored by version control systems.

  5. Configure history cache handling.

  6. Define issue navigation rules to switch from check-in comments to corresponding issues in a bug tracking system.

To specify which actions should require confirmation

You can define that certain version control related activities should be performed only upon confirmation from your side. The activities for which confirmation is required are specified in the Confirmation settings page.

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), under the Version Control node, select the Confirmation page.

  2. In the Files Creation/Deletion area, define how files created or deleted in PyCharm should be added to or removed from a version control system. The available options are:
    • Show options before adding to version control

    • Add silently

    • Do not add

  3. In the Display options dialog when these commands are invoked area, specify the commands, for which you want PyCharm to display the Options dialog box. The available options are:
    • Check Out

    • Status

    • Get Latest Version

    • Update

    • Undo Check Out

  4. Configure additional settings for working with changelists by selecting or clearing the corresponding checkboxes:
    • Specify whether the read-only state of files should require explicit cancellation.

    • Specify whether meaningful comments on committing files to the repository should be required.

    • Specify whether uncommitted changes should be moved to another changelist.

    • Specify whether and how to create a changelist if the commit operation fails.

To specify the operations to run in the background

You can enable background execution of certain version control related activities. These activities are specified in the Background settings page.

  1. Below the In the Settings/Preferences dialog (Ctrl+Alt+S), under the Version Control node, select the Background page.

  2. Enable background execution of the necessary actions by selecting the corresponding checkboxes. Background execution can be set for the following actions:

To define a list of ignored files

Sometimes you may need to leave files of certain types unversioned. These can be VCS administration files, artifacts of utilities, backup copies, etc. You can create a global ignore list that will be stored in the workspace file and applied to all supported version control systems.

The files you want to ignore can be appointed explicitly by their names of through name patterns with wildcards. To ignore a directory, you need to specify the full path to it relative to the project root.

Use the Ignored Files settings page to list files that must be excluded from version control operations.

Note that once you've added a file to a version control system, ignoring it will have no effect. You need to remove it from your VCS first.

  1. Open the Ignored Files settings page by doing one of the following:
    • In the Settings/Preferences dialog (Ctrl+Alt+S), under the Version Control node, click Ignored Files.

    • In the Local Changes tab of the Version Control tool window, click icons actions show svg on the toolbar and select Configure Ignored Files.

  2. Click icons general add svg (Alt+Insert) to create a new entry, or select an existing entry and click icons actions edit svg (Enter). The Ignore Unversioned Files dialog box opens:

    configureIgnoredFiles

  3. Explicitly specify the files/directories to be ignored or define file name patterns. Do one of the following:
    • Choose the Ignore specified file option and specify the file name relative to the project root, for example, my_folder/my_subfolder1/my_subfolder2/my_file. Type the name manually or click Browse browseButton and select the desired file in the Select File to Ignore dialog box.

    • Choose the Ignore all files under option and specify the directory whose contents should be ignored. Type the directory name relative to the project root, for example, my_folder/my_subfolder1/, or click Browse button browseButton and select the desired folder in the Select Directory to Ignore dialog box.

      The rule is applied recursively to all subdirectories of the specified directory. If a directory has several subdirectories and you want only one of them ignored, specify the required directory explicitly, for example, my_folder/my_subfolder1/my_subfolder2/.

    • Select the Ignore all files matching option and type the pattern that defines the names of files to be ignored.

      Patterns that define files to ignore, make use of two wildcards.

  4. Create as many entries as you need and close the dialog box.

To configure history cache handling

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), under the Version Control node, select the Background page.

  2. Set the cache scope. Depending on the version control system you are using, do one of the following:
    • Specify the maximum number of changelists to be stored in the cache.

    • Specify the maximum number of days for a changelist to be stored in the cache.

  3. Specify whether and how often (in minutes) you want your version control system to refresh the cache.

Configuring VCS-specific settings

Certain settings are applicable to the version control systems assigned to the whole project, or its directories. The others are related to the selected version control systems. Use the respective VCS pages under the VCSs node of the Settings dialog box to define VCS-specific settings.

To configure VCS-specific settings, follow these general steps

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), click Version Control, and then click the page for your VCS.

  2. Set up options as required. For detailed information, see VCS-specific pages of the Version Control settings.

Last modified: 27 February 2019

See Also