반응형

Step 1: Install WinMerge

If you haven't installed WinMerge yet, download and install it from the official website: WinMerge Download.

Step 2: Install Git

Make sure Git is installed on your system. You can download it from the official website: Git Download.

Step 3: Configure WinMerge as Git's Merge Tool

  1. Open a command prompt or Git Bash.
  2. Run the following commands to configure WinMerge as the default merge tool for Git:

bashCopy code

git config --global merge.tool winmerge
git config --global mergetool.winmerge.path "C:/Program Files/WinMerge/WinMergeU.exe"
git config --global mergetool.winmerge.cmd "C:/Program Files/WinMerge/WinMergeU.exe" -e -u -wl -dl \"Local\" -dr \"Remote\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"

 

Make sure to adjust the path to WinMerge if it's installed in a different location.

 

Step 4: Handle Conflicts using WinMerge

  1. When you encounter a merge conflict during a Git operation (e.g., git pull), Git will invoke WinMerge to help you resolve it.
  2. WinMerge will open with the three panels:
  3. Manually resolve the conflicts by selecting the changes you want to keep from the local or remote versions.
  4. Save the merged file and close WinMerge.
  5. Back in the command prompt or Git Bash, run git merge --continue to complete the merge process.

Step 5: Verify Configuration

To verify that WinMerge is set up correctly, you can run:

git mergetool

 

 

This command will launch WinMerge for a test merge. If everything is configured properly, you should see the merge tool in action.

Now you can efficiently use WinMerge as your Git merge tool on Windows.

 

 

반응형

+ Recent posts