• [PyCharm IDE]
 

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

When you start working on a project in PyCharm, version control is disabled. However, there is the main menu item

VCS
span
classshortcut
Wiki Markup
{span:class=shortcut}VCS{span}
that contains certain commands:

...

Click , and in the Settings dialog, click Version Control. By default, the only root is

span
classcode
<project>
Wiki Markup
{span:class=code}&lt;project&gt;{span}
, and it is not mapped to any version control system. Let's do it.

...

  • You see the new color code of the file
    span
    classcode
    Wiki Markup
    {span:class=code}Solver.py{span}
    . Now it is brown, which means that the file exists, but is not yet added to the version control.
  • Changes tool window appears - you see its button along the lower border of PyCharm. Click this button to open the tool window, and see the list of unversioned files. Later we'll see what to do with them.
  • The VCS menu, and the VCS operations pop-up now show more commands. In particular, you see the commands that allow checking your changes in the repository, and updating the entire project. These commands are denoted with the icons and respectively.
  • Same icons appear on the main toolbar.
  • A Git node appeared on the VCS menu, and on the context menus of the Project tool window and the editor. Have we selected a different version control system to associate with a directory, this node would be different (Perforce, CVS, etc.). This node contains VCS-specific commands.
  • In the Status bar, you see the Git widget - this is a Git-specific modification.

...

Look at the list of unversioned files in the Changes tool window:

Select

span
classcode
Wiki Markup
{span:class=code}Solver.py{span}
, and press
span
classshortcut
Wiki Markup
{span:class=shortcut}Ctrl+Alt+A{span}
to add this file to version control: you see that the color code of the file changed - now it is green, which means that the file is added to version control, but not yet committed to the repository. The file moved to the new changelist with the name Default. Now press
span
classshortcut
Wiki Markup
{span:class=shortcut}Ctrl+K{span}
(or click button in the Changes tool window) to commit your changes:

...

Next, enter your check-in comment, and finally click the

Commit
span
classshortcut
Wiki Markup
{span:class=shortcut}Commit{span}
button:

OK, the changes are checked in. The Default changelist is now empty, and the color code of the file name

span
classcode
Wiki Markup
{span:class=code}Solver.py{span}
changed again - it became black, which means that there are no pending changes.

...

There are more unversioned files left. If you click the button in the Changes tool window, you will see that all these files reside in the directory

.idea
span
classcode
Wiki Markup
{span:class=code}.idea{span}
under the project root. However, we don't see this directory under the project root in the Project tool window.

...

This only file that should be ignored, stores your workspace preferences; its name is

span
classcode
Wiki Markup
{span:class=code}workspace.xml{span}
. The file
span
classcode
Wiki Markup
{span:class=code}workspace.xml{span}
is ignored by default. Open the Ignored Files page of the Settings dialog (Version Control→Ignored Files
span
classshortcut
Wiki Markup
{span:class=shortcut}Version Control&rarr;Ignored Files{span}
), and see the list of files ignored by version control by default:

...

Suppose somebody else is working on the same project. Now you want to get the external changes locally. PyCharm, as usual, provides several ways to do it:

  • Press
    span
    classshortcut
    Wiki Markup
    {span:class=shortcut}Ctrl+T{span}
  • Click on the main toolbar
  • Choose VCS→Update
    span
    classshortcut
    Wiki Markup
    {span:class=shortcut}VCS&rarr;Update Project...{span}

The action per se is VCS-agnostic. However, the dialog box that shows up when you invoke updating, is VCS-dependent. It will be different, for example, for Git update and for Perforce update - compare the dialog descriptions.

...