- Open Android Studio
- Go to: Tools > Create Command-line Launcher
- Leave as default, Press OK
- Add the following lines to your
.gitconfig
[merge]
tool = studio
[mergetool "studio"]
cmd = studio 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
[diff]
tool = studio
[difftool "studio"]
cmd = studio diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
https://www.jetbrains.com/idea/help/running-intellij-idea-as-a-diff-or-merge-command-line-tool.html http://brian.pontarelli.com/2013/10/25/using-idea-for-git-merging-and-diffing/