Windows上的Intellij Idea和社区版本的Git Mergetool

发布于 2025-01-24 04:22:56 字数 784 浏览 0 评论 0原文

我正在使用gitextensions Windows软件与GIT一起使用,并且我将其配置为与Idea的社区版一起使用,将其用作合并工具。 我已经安装了Intellij Idea Community的2022.1版本,

我在此处遵循说明 https://coderwall.com/p/gc_hqw/use-intellij-or-webstorm-webstorm-as-as-your-git-diff-diff-wiff-tool-even-even-windows ,但是我对解决冲突并不适合我,

我去了文件夹C:\ users< login>编辑.gitConfig文件 我在其中添加了以下各

[merge]
        tool = intellij
[mergetool "intellij"]
        cmd = cmd.exe //c "\"C:/Program Files/IntelliJ IDEA Community Edition 2022.1/bin/idea.bat\" merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
        trustExitCode = true    

I'm using GitExtensions windows software to work with git and i had many trouble configuring it to work with Idea's community edition, to use it as a merge tool.
I've installed version 2022.1 of intelliJ Idea community

I followed the instructions here https://coderwall.com/p/gc_hqw/use-intellij-or-webstorm-as-your-git-diff-tool-even-on-windows but it didn't worked for me for conflict resolution

i went to the folder c:\users<login> to edit the .gitconfig file
and i added the following sections in it

[merge]
        tool = intellij
[mergetool "intellij"]
        cmd = cmd.exe //c "\"C:/Program Files/IntelliJ IDEA Community Edition 2022.1/bin/idea.bat\" merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
        trustExitCode = true    

but nothing was launched when launching the mergetool

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紅太極 2025-01-31 04:22:56

我在Windows 11上使用gitextensions在Windows 11上发现了这对我而言。
我不再需要首先指定cmd.exe应用程序,但是我必须使用“路径”值。这也可以通过GiteXtensions中的“设置Git-&gt; config”菜单设置,如果在下拉式选择器中未列出,则可以在其中手动输入“ Intellij”。

我的.gitConfig文件的底部看起来像这样:

[diff]
    guitool = intellij
[difftool "intellij"]
    path = C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3.2/bin/idea.bat
    cmd = \"C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3.2/bin/idea.bat\" diff \"$LOCAL\" \"$REMOTE\"
[merge]
    guitool = intellij
[mergetool "intellij"]
    path = C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3.2/bin/idea.bat
    cmd = \"C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3.2/bin/idea.bat\" merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

我可以确认difftool命令现在用gitextensions的外部工具为我的diff打开Intellij,但是由于缺乏在我的repo中合并的文件,我尚未尝试合并。

I've found this works for me so far on Windows 11, using GitExtensions.
I no longer need to specify the cmd.exe app first, but I have to use a "path" value. This can also be set through the "Settings-Git->Config" menu in GitExtensions, where you can manually type in "intellij" if it's not listed in the dropdown selector.

The bottom of my .gitconfig file looks like this:

[diff]
    guitool = intellij
[difftool "intellij"]
    path = C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3.2/bin/idea.bat
    cmd = \"C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3.2/bin/idea.bat\" diff \"$LOCAL\" \"$REMOTE\"
[merge]
    guitool = intellij
[mergetool "intellij"]
    path = C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3.2/bin/idea.bat
    cmd = \"C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3.2/bin/idea.bat\" merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

I can confirm that the difftool command now opens IntelliJ for my diffs with an external tool from GitExtensions, but I have yet to try a merge, due to lack of files to merge in my repo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文