QA
Senior LevelGit & GitHub

How do you configure custom 3-way merge tools in .gitconfig?

❓ Interview Prompt: Explain git mergetool and git difftool configuration, binding custom 3-way visual editors (VS Code, KDiff3, Beyond Compare), and placeholders.

Configuring mergetool bindings in .gitconfig defines custom 3-way merge execution commands (%BASE, %LOCAL, %REMOTE, %MERGED) for visual conflict resolution in VS Code or KDiff3.

Code Implementation Example

ini
[merge]
    tool = vscode
[mergetool "vscode"]
    cmd = code --wait --merge $LOCAL $REMOTE $BASE $MERGED
💡Configuring VS Code as custom 3-way visual merge tool in .gitconfig.
🎯 Interview Key Takeaway

Configure mergetool in .gitconfig using $LOCAL, $REMOTE, $BASE, and $MERGED placeholders for visual 3-way conflict resolution.

#git mergetool#Visual Merge#VS Code#Senior
Back to all Git & GitHub Questions→

More Git & GitHub Interview Questions

Beginner LevelGit & GitHub

Compare git rebase versus git merge and explain how git bisect finds regressions.

Beginner LevelGit & GitHub

What is the difference between git init and git clone?

Beginner LevelGit & GitHub

What are the Three Trees in Git (Working Directory, Staging Area / Index, Commit History)?