PyCharm and source control, the .idea directory, commit or not commit, that is the question
I started a new PyCharm project and want to version it with Mercurial.
There is a .idea directory in the project directory with the following files (and my assumption about whether to version them or not)
- .name - c开发者_StackOverflow中文版ontains the name of the project (version: yes)
- encodings.xml - contains defaults(?) for text file encoding (version: yes)
- misc.xml - contains something about components, and which Python executable to use (version: no - because it hard-codes the path to python.exe)
- modules.xml - contains a list of modules, with the name of the project in them (version: yes)
- ProjectName.iml (version: yes)
- vcs.xml - specifies which VCS to use (version: yes
- workspace.xml - seems to list layout information for PyCharm windows (version: no)
Are my assumptions correct?
All files except workspace.xml should be shared, see the FAQ.
Depends on whether you want to share just the code or share the code and project settings too.
For just sharing the code, I add the following to the .hgignore file:
^.idea
^.idea/*
/*/.idea
/*/.idea/*
The patterns are a bit overkill, but they eliminate all the PyCharm/Workspace stuff.
We primarily use Subversion where I work and I frequently create a Mercurial repo on top of the Subversion checkout to play with possible tweaks and changes. If you go that route and in particular if you chain the Mercurial repos, then add these entries to the .hgignore file too:
^.svn
^.svn/*
/*/.svn
/*/.svn/*
精彩评论