Skip to content

Instantly share code, notes, and snippets.

@witoszekdev
Last active February 21, 2022 14:41
Show Gist options
  • Save witoszekdev/c36f9143e589ea6ffb3a06c029a8add1 to your computer and use it in GitHub Desktop.
Save witoszekdev/c36f9143e589ea6ffb3a06c029a8add1 to your computer and use it in GitHub Desktop.

Revisions

  1. witoszekdev revised this gist Feb 21, 2022. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions explanation.md
    Original file line number Diff line number Diff line change
    @@ -32,8 +32,7 @@ Open `~/.gitconfig` file (it should be in your home directory) in your favourite
    [mergetool]
    keepBackup = false
    [mergetool "webstorm"]
    cmd = webstorm merge $LOCAL $REMOTE $BASE $MERGED --wait
    trustExitCode = true
    cmd = webstorm merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\" && read
    [difftool "webstorm"]
    cmd = webstorm diff $LOCAL $REMOTE --wait
    trustExitCode = true
    @@ -46,7 +45,7 @@ This will use WebStorm as your default mergetool and difftool.
    > [merge]
    > tool = pycharm
    > [mergetool "pycharm"]
    > cmd = pycharm merge $LOCAL $REMOTE $BASE $MERGED --wait
    > cmd = pycharm merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\" && read
    > ```
    > The `keepBackup = false` will disable git creating `*.orig` files when performing merge
    @@ -55,7 +54,9 @@ This will use WebStorm as your default mergetool and difftool.
    When you encounter merge conflicts just run `git mergetool` to open up WebStorm. Don't worry it won't open the *entire* IDE, just the merge conflict resolution tool.
    After youre done resolving conflicts just close the app and it will go to the next conflict.
    To speed up the startup time of WebStorm keep it open in the backgroud. You don't need to open any project.
    After you've resolved the conflicts press `Enter` in the commandline. WebStorm will open for each conflicting file.
    > Wait! Why doesn't VSCode have this feature?
    > Well... there's [been a proposal from 2017](https://github.com/microsoft/vscode/issues/37350), but since then VSCode team have removed this feature from the roadmap
  2. witoszekdev revised this gist Feb 21, 2022. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions explanation.md
    Original file line number Diff line number Diff line change
    @@ -29,6 +29,8 @@ Open `~/.gitconfig` file (it should be in your home directory) in your favourite
    tool = webstorm
    [diff]
    tool = webstorm
    [mergetool]
    keepBackup = false
    [mergetool "webstorm"]
    cmd = webstorm merge $LOCAL $REMOTE $BASE $MERGED --wait
    trustExitCode = true
    @@ -47,6 +49,8 @@ This will use WebStorm as your default mergetool and difftool.
    > cmd = pycharm merge $LOCAL $REMOTE $BASE $MERGED --wait
    > ```
    > The `keepBackup = false` will disable git creating `*.orig` files when performing merge
    ## 3. Resolve merge conflict
    When you encounter merge conflicts just run `git mergetool` to open up WebStorm. Don't worry it won't open the *entire* IDE, just the merge conflict resolution tool.
  3. witoszekdev revised this gist Feb 21, 2022. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions explanation.md
    Original file line number Diff line number Diff line change
    @@ -49,9 +49,11 @@ This will use WebStorm as your default mergetool and difftool.
    ## 3. Resolve merge conflict
    When you encounter merge conflicts just run `git mergetool` to open up WebStorm. After youre done resolving conflicts just close the app and it will go to the next conflict.
    When you encounter merge conflicts just run `git mergetool` to open up WebStorm. Don't worry it won't open the *entire* IDE, just the merge conflict resolution tool.
    ![Using WebStorm for merge conflict resolution](https://resources.jetbrains.com/help/img/idea/2021.3/ws_conflict_resolution_tool_legend.png)
    After youre done resolving conflicts just close the app and it will go to the next conflict.
    > Wait! Why doesn't VSCode have this feature?
    > Well... there's [been a proposal from 2017](https://github.com/microsoft/vscode/issues/37350), but since then VSCode team have removed this feature from the roadmap
    > Well... there's [been a proposal from 2017](https://github.com/microsoft/vscode/issues/37350), but since then VSCode team have removed this feature from the roadmap
    ![Using WebStorm for merge conflict resolution](https://resources.jetbrains.com/help/img/idea/2021.3/ws_conflict_resolution_tool_legend.png)
  4. witoszekdev revised this gist Feb 21, 2022. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions explanation.md
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,9 @@

    Don't like using VSCode merge conflicts resolution? Try WebStorm's instead.

    ## 0. Download WebStorm
    ## 0. [Download WebStorm](https://www.jetbrains.com/webstorm/download)

    or any other Jetbrains IDE. If you don't want to buy Webstorm's licence try PyCharm Community Edition instead.
    or any other Jetbrains IDE. If you don't want to buy Webstorm's licence try [PyCharm Community Edition](https://www.jetbrains.com/pycharm/download) instead.

    ## 1. Generate shell scripts

    @@ -49,4 +49,9 @@ This will use WebStorm as your default mergetool and difftool.
    ## 3. Resolve merge conflict
    When you encounter merge conflicts just run `git mergetool` to open up WebStorm. After youre done resolving conflicts just close the app and it will go to the next conflict.
    When you encounter merge conflicts just run `git mergetool` to open up WebStorm. After youre done resolving conflicts just close the app and it will go to the next conflict.
    ![Using WebStorm for merge conflict resolution](https://resources.jetbrains.com/help/img/idea/2021.3/ws_conflict_resolution_tool_legend.png)
    > Wait! Why doesn't VSCode have this feature?
    > Well... there's [been a proposal from 2017](https://github.com/microsoft/vscode/issues/37350), but since then VSCode team have removed this feature from the roadmap
  5. witoszekdev revised this gist Feb 21, 2022. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion explanation.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    <p align="center">
    <img width="400" src="https://upload.wikimedia.org/wikipedia/commons/5/59/WebStorm_logo.svg">
    <img width="400" src="https://upload.wikimedia.org/wikipedia/commons/5/59/WebStorm_logo.svg" alt="WebStorm">
    </p>

    <p align="center">
    @@ -16,6 +16,10 @@ or any other Jetbrains IDE. If you don't want to buy Webstorm's licence try PyCh

    Open your Jetbrains Toolkit and enable generation of shell scripts. Provided the folder that exists in your `$PATH`. I've used `/usr/local/bin`.

    <p align="center">
    <img height="500" src="https://gist.github.com/taniotanio7/c36f9143e589ea6ffb3a06c029a8add1/raw/3140cd79c86771c6419e39b0a3978600559e5acd/jetbrains-toolkit.png" alt="Configuration inside Jetbrains Toolkit application" />
    </p>

    ## 2. Edit `.gitconfig`

    Open `~/.gitconfig` file (it should be in your home directory) in your favourite editor and add this configuration
  6. witoszekdev revised this gist Feb 21, 2022. 1 changed file with 0 additions and 0 deletions.
    Binary file added jetbrains-toolkit.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  7. witoszekdev created this gist Feb 21, 2022.
    48 changes: 48 additions & 0 deletions explanation.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    <p align="center">
    <img width="400" src="https://upload.wikimedia.org/wikipedia/commons/5/59/WebStorm_logo.svg">
    </p>

    <p align="center">
    <b>as git mergetool</b>
    </p>

    Don't like using VSCode merge conflicts resolution? Try WebStorm's instead.

    ## 0. Download WebStorm

    or any other Jetbrains IDE. If you don't want to buy Webstorm's licence try PyCharm Community Edition instead.

    ## 1. Generate shell scripts

    Open your Jetbrains Toolkit and enable generation of shell scripts. Provided the folder that exists in your `$PATH`. I've used `/usr/local/bin`.

    ## 2. Edit `.gitconfig`

    Open `~/.gitconfig` file (it should be in your home directory) in your favourite editor and add this configuration

    ```properties
    [merge]
    tool = webstorm
    [diff]
    tool = webstorm
    [mergetool "webstorm"]
    cmd = webstorm merge $LOCAL $REMOTE $BASE $MERGED --wait
    trustExitCode = true
    [difftool "webstorm"]
    cmd = webstorm diff $LOCAL $REMOTE --wait
    trustExitCode = true
    ```

    This will use WebStorm as your default mergetool and difftool.

    > Note: If you're using different Jetbrains IDE use it's name instead of `webstorm`. For example, for PyCharm:
    > ```properties
    > [merge]
    > tool = pycharm
    > [mergetool "pycharm"]
    > cmd = pycharm merge $LOCAL $REMOTE $BASE $MERGED --wait
    > ```
    ## 3. Resolve merge conflict
    When you encounter merge conflicts just run `git mergetool` to open up WebStorm. After youre done resolving conflicts just close the app and it will go to the next conflict.