Set git default diff- and mergetool to pyCharm
Hello,
I'd like to have pyCharm set as my default diff- and mergetool for git.
For instance if I type merge command in console and if conflict occurs pyCharm will be opened instead of that vi-style-looking default difftool.
I'd like to have pyCharm set as my default diff- and mergetool for git.
For instance if I type merge command in console and if conflict occurs pyCharm will be opened instead of that vi-style-looking default difftool.
Please sign in to leave a comment.
However I am not sure what are these arguments 'file1', 'file2'?
I use git and I want to compare a file from current revision with the very same file from previous revision, but I don't know where the file from previous revision resides.
If it works in such a way that I have to type:
'charm diff <file_from_current_revision> <file_form_previous_revision>'
then it is pretty unhandy...
Is there any way to set that command to always work in following way:
charm diff fileX
to launch PyCharm diff tool on fileX from current revision and fileX from previous revision?
Thanks for your answer.
<disclaimer>
I'm still very new to both git, github, and to pycharm.
And
I've not actually written the following script to see if it works yet.
</disclaimer>
I did notice that this question was unresolved, and I noticed because I had the same question myself. So in the interest in potentially helping (even though this thread is 7 years old!) I provide the following link from git-scm (https://git-scm.com/docs/git-difftool) which indicates that you can customize git difftool to "o run an alternative program by specifying the command line to invoke..." which includes env variables that appear to have pointers to the before and after, implying a simple scrip will make the translation to [pycharm | charm] merge <file1> <file2>. I've added it to (the bottom) of my list of things, and if I remember, I'll post back the script that works (or doesn't).
OK. I've got an alternative solution that appears to be working.
And I must say that the diff tool in pycharm is quite nice, now that I see it working!
Starting here:
https://coderwall.com/p/h1m3pw/setting-your-own-difftool
I added this to my ~/.gitconfig
Note that I'm using forward slashes so I don't have to deal with escaping the back slashes.
Note also that I have escaped out the outer quotes