1. Theme
Introducing the version control system of Pycharm
2. Preparatory work
(1) Pycharm version is 2.7 or higher
(2) A project has been created, see Getting Started Tutorial
(3) The VCS is installed and configured with remote access privileges
3. Enable VCs
Pycharm default versioning is not available, but you can find the appropriate command in the VCs menu:
At this point pycharm will browse the external resources based on the local history, and even enable the version control system from this menu, although versioning is only available for the engineering root, with more specific configurations see the sections below.
4. Enable version control
Click the control button on the main toolbar, click Version Control, and by default there is only root <project>.
First, click the Green plus sign in the Add VCS Directory Mapping dialog box, click the ellipsis button, select the corresponding directory, and specify the version control system in the down menu below (git is used here).
Of course, you can specify a corresponding version control system for each directory.
Then, click Apply to close the dialog box
5. Influence on the appearance of Pycharm
(1) solver.py file color change, meaning it has not been added version control
(2) A Changes tool window appears, similar to a button located at the bottom edge of the pycharm. Click to open the window to view files that have not yet been added to the version control.
(3) More commands appear on the VCs menu and allow viewing of project changes as well as updating the entire project, correspondence and buttons. The main toolbar also adds response commands
(4) The Git node (depending on the version control selected) appears in the VCs menu and the project shortcut menu, which contains the specific VCS commands
(5) A Git widget appears in the status bar
6. Add version control to a file
Files that are not versioned in the Changes tool Windows window are displayed as follows:
Select solver.py, press Ctrl+alt+a to add the corresponding versioning, the file color turns green, the add succeeds, but it is not yet managed. Move the file to the default change table and press Ctrl+k (or) to host it:
To verify the error, click the commit button:
Done, the solver.py file name turns black again, meaning that there are no changes that are not updated at the moment.
7. Files under the idea directory
Click the button in the Changes tool window to find that the files under the idea directory under the project root are not versioned, and this part of the file is not visible in the Project window.
This part of the file holds the configuration information for the project, which we need to replace, in addition to the version control file.
8. Ignoring files
Open the ignored Files page of the Settings dialog box (set →version control→ignored files) to view the default list of ignored files:
Click the green plus sign to select ignore more files, see Configuring ignored files.
9. Changes in the editor
Edit the code, and the left slot will mark all changes:
Click a marker and a tool window will pop up:
This popup toolbar can help you navigate, navigate through changes, and more.
For more information see Using change markers to View and Navigate Through changes in the Editor
The code file name changes to blue, which means that there is currently a change that has not been managed.
10. Get Update Date
Press the Ctrl+t
Click the button
Use Vcs→update Project ... menu commands
Most complete Pycharm tutorial (PNS)--pycharm version Control basics