Skip to content

Instantly share code, notes, and snippets.

@frgomes
Last active October 19, 2025 16:21
Show Gist options
  • Select an option

  • Save frgomes/89e1e204a4497e0e60eaa5af7a8d0c0f to your computer and use it in GitHub Desktop.

Select an option

Save frgomes/89e1e204a4497e0e60eaa5af7a8d0c0f to your computer and use it in GitHub Desktop.
Git - Integration with IntelliJ's diff & merge tools
[user]
name = Richard Gomes
email = noreply@example.com
[alias]
pullall = !"git pull origin -v && git pull upstream -v"
fetchall = !"git fetch origin -v && git fetch upstream -v"
fetch-force = !"git fetch && git reset --hard FETCH_HEAD && git clean -df"
incoming = !"git fetch && git log ..origin/master"
unstage = reset HEAD
pre-merge = merge --no-commit --no-ff
[push]
default = simple
[pull]
rebase = true
[init]
defaultBranch = main
# ---------------------------------
# Diff Tool Definitions
#
# Run the default (meld) with: git difftool
# Run a specific one with: git difftool -t <name>
# ---------------------------------
[diff]
# Set 'meld' as the default tool to run when you type `git difftool`.
tool = difft
[difftool]
prompt = false
[difftool "meld"]
# Command to run meld for visual diffing.
cmd = meld "$LOCAL" "$REMOTE"
[difftool "sdiff"]
# Configure sdiff as an optional console-based difftool.
# -s suppresses common lines, -w 120 sets the width.
cmd = sdiff -s -w 1320 "$LOCAL" "$REMOTE"
[difftool "difft"]
# Configure difft (difftastic) as an optional difftool.
# This will show a structural diff in your console.
cmd = difft "$LOCAL" "$REMOTE"
# ---------------------------------
# Merge Tool Definitions
# ---------------------------------
[merge]
# Set 'meld' as the default tool for `git mergetool`.
tool = meld
# Show a 3-way merge (LOCAL, BASE, REMOTE) in conflicts.
conflictstyle = diff3
[mergetool]
prompt = false
[mergetool "meld"]
# Configure meld for 3-way merging.
cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
trustExitCode = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment