I'm a heavy Eclipse PyDev + EGit user and looking to switch to PyCharm. In Eclipse, I can choose to add only certain hunks/lines of a file to the git index, the same as using git add -p
from the terminal. I find doing it through a GUI to be faster, and I have been looking for the same functionality in PyCharm. Does it exist? Thanks
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- pycharm上传代码到github,为什么不能指定某一个项目,而是默认上传第一个项目
- 请教Git如何克隆本地库?
- Profiling Django with PyCharm
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- How to fix this strange error: “RuntimeError: CUDA
- SSIS solution on GIT?
- Is there a version control system abstraction for
Since Pycharm 2018 partial commit (similar to
git add -p
) can be set up by two settings:Settings-> General -> Other -> Highlight modified lines in gutter
Settings -> Version Control -> Changelists -> Track changed blocks in text files separately
After that, you will be able to move code blocks to different change-lists or de-select blocks from the commit
This is not currently supported. Follow this ticket for details (comment/watch to be notified when it will be implemented).
http://youtrack.jetbrains.com/issue/IDEA-63201
UPDATE 2018-03-13:
This functionality is now implemented (more or less) and will be available in 2018.1 version. A bit more can be found in this blog post.
This is a late comment, but may be helpful to some.
PyCharm has this issue open. This issue, and its duplicates, has been open since at least 2012. Don't hold your breath.
Putting changes in file by file is trivial, just by clicking boxes.
On OS/X, use the GitHub Desktop tool for those cases where you want fine grain commits. It has the correct 'click and drag over blocks of line' interface for this.
PyCharm manages this through change lists. Here is an example.
VCS
->Commit Changes
{1}
, you can see that the changelist is set toDefault
, and in{2}
you can see the actual change. Right click on{2}
and select the change.Now, say we want to commit only this change. We can do this by adding it to a new changelist, by clicking on
{3}
, and this will pop up:Since we don't have a new one, let's just create a new changelist using the dialog box. And then let's change the currently selected changelist to
New Changelist
:Notice that there is only one file, with one change, just like our changelist. How about we add a few things from the
default
changelist to the new one:Now, let's head back to the
New Changelist
:Now that we're done with our selective changes, press
Commit
. After this, we can push:I pushed to bitbucket, so let's see the changes:
As you can see, only the stuff in the
New Changelist
was added.