-
-
Save idefav/2bd1ed7683e127549b7df4e73b929bf6 to your computer and use it in GitHub Desktop.
Revisions
-
ffittschen revised this gist
Jun 24, 2016 . 1 changed file with 21 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,25 +1,32 @@ # Use IntelliJ or WebStorm as git mergetool ## Configure Sourcetree The merge tool that ships with JetBrain's IntelliJ IDEA or WebStorm is really awesome and way better than `FileMerge`. It is quite simple to configure SourceTree to use it as the default mergetool: 1. Open the SourceTree preferences and select the `Diff` tab 2. Choose `Custom` both as `Visual Diff Tool` and as `Merge Tool` 3. Paste the following commands into the textfields: - **Diff Command:** `/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea diff` - **Arguments:** `$(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")` - **Merge Command:** `/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea merge` - **Arguments:** `$(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")` 1. Close the settings. Happy merging! ## Git in general To manually change the mergetool for git in general follow these steps: 1. Open the `~/.gitconfig` file with your favorite editor 1. Add these lines somewhere in the config: ``` [merge] tool = intellij [difftool "intellij"] cmd = /Applications/IntelliJ\\ IDEA.app/Contents/MacOS/idea diff $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") [mergetool "intellij"] cmd = /Applications/IntelliJ\\ IDEA.app/Contents/MacOS/idea merge $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") $(cd $(dirname \"$BASE\") && pwd)/$(basename \"$BASE\") $(cd $(dirname \"$MERGED\") && pwd)/$(basename \"$MERGED\") trustExitCode = true ``` -
ffittschen revised this gist
Jun 24, 2016 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,4 +24,9 @@ The merge tool that ships with JetBrain's IntelliJ IDEA or WebStorm is really aw trustExitCode = true ``` ## Downsides It takes a few more seconds to launch the IntelliJ merge tool than to launch FileMerge, but it is definitely worth waiting. ## Credits Based on this article on coderwall: https://coderwall.com/p/gc_hqw/use-intellij-or-webstorm-as-your-git-diff-tool-even-on-windows -
ffittschen revised this gist
Jun 24, 2016 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ The merge tool that ships with JetBrain's IntelliJ IDEA or WebStorm is really aw 1. Open the `~/.gitconfig` file with your favorite editor 2. Find the following lines: ``` [difftool "sourcetree"] cmd = opendiff \"$LOCAL\" \"$REMOTE\" @@ -12,7 +13,9 @@ The merge tool that ships with JetBrain's IntelliJ IDEA or WebStorm is really aw cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" trustExitCode = true ``` 3. Edit the lines to look like this: ``` [difftool "sourcetree"] cmd = /Applications/IntelliJ\\ IDEA.app/Contents/MacOS/idea diff $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") -
ffittschen revised this gist
Jun 24, 2016 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,21 +4,21 @@ The merge tool that ships with JetBrain's IntelliJ IDEA or WebStorm is really aw 1. Open the `~/.gitconfig` file with your favorite editor 2. Find the following lines: ``` [difftool "sourcetree"] cmd = opendiff \"$LOCAL\" \"$REMOTE\" path = [mergetool "sourcetree"] cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" trustExitCode = true ``` 3. Edit the lines to look like this: ``` [difftool "sourcetree"] cmd = /Applications/IntelliJ\\ IDEA.app/Contents/MacOS/idea diff $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") [mergetool "sourcetree"] cmd = /Applications/IntelliJ\\ IDEA.app/Contents/MacOS/idea merge $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") $(cd $(dirname \"$BASE\") && pwd)/$(basename \"$BASE\") $(cd $(dirname \"$MERGED\") && pwd)/$(basename \"$MERGED\") trustExitCode = true ``` Based on this article on coderwall: https://coderwall.com/p/gc_hqw/use-intellij-or-webstorm-as-your-git-diff-tool-even-on-windows -
ffittschen created this gist
Jun 24, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ # Use IntelliJ or WebStorm as git mergetool with SourceTree The merge tool that ships with JetBrain's IntelliJ IDEA or WebStorm is really awesome and way better than `FileMerge`. It is quite simple to configure SourceTree to use it as the default mergetool: 1. Open the `~/.gitconfig` file with your favorite editor 2. Find the following lines: ``` [difftool "sourcetree"] cmd = opendiff \"$LOCAL\" \"$REMOTE\" path = [mergetool "sourcetree"] cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" trustExitCode = true ``` 3. Edit the lines to look like this: ``` [difftool "sourcetree"] cmd = /Applications/IntelliJ\\ IDEA.app/Contents/MacOS/idea diff $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") [mergetool "sourcetree"] cmd = /Applications/IntelliJ\\ IDEA.app/Contents/MacOS/idea merge $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") $(cd $(dirname \"$BASE\") && pwd)/$(basename \"$BASE\") $(cd $(dirname \"$MERGED\") && pwd)/$(basename \"$MERGED\") trustExitCode = true ``` Based on this article on coderwall: https://coderwall.com/p/gc_hqw/use-intellij-or-webstorm-as-your-git-diff-tool-even-on-windows