Skip to content

Direct Git Integration (Version 2.6.1 or newer)

You want to use the best eap merging tool with the best versioning control system? Read ahead!

Using TortoiseGit? Please see TortoiseSVN Integration (Version 2.6.1 or newer) instead (the handling of TortoiseGit and TortoiseSVN is very similar). The instructions below might conflict with TortoiseGit!

Starting from LemonTree 2.6.1, you should set up Git to utilize the LemonTree Starter instead of invoking LemonTree directly. This is done by using the commands below. For more details on the LemonTree Starter, please visit this page: LemonTree Starter

If you've already set up a LemonTree Git Integration for LemonTree, you can safely run the commands below (except the section for the .gitattributes, which shouldn't be necessary anymore) to update your configuration.

1. Setting up automatic merging

Windows Command Prompt & Git Bash

git config --global merge.lemontree.name "lemontree merge driver"
git config --global merge.lemontree.driver "'C:/Program Files/LieberLieber/LemonTree/LemonTree.Starter.exe' merge --base=\"%O\" --mine=\"%A\" --theirs=\"%B\" --out=\"%A\""
git config --global merge.lemontree.recursive binary

This will register lemontree as a merge driver which can automatically merge files. We still need to register it for certain types though. Make sure you are in $REPO!

1.1. Without using Git-LFS

Windows Command Prompt & Git Bash

echo "*.eap merge=lemontree" >> .gitattributes
echo "*.EAP merge=lemontree" >> .gitattributes
git add .gitattributes
git commit -am "added gitattributes"

1.2. When using Git-LFS

If you're using Git-LFS for Files you want to diff with LemonTree, you will already have an entry for these files in your .gitattributes file.

It will most likely look something like this:

*.eap filter=lfs diff=lfs merge=lfs -text

To utilize LemonTree here, you need to change this line like so:

*.eap filter=lfs diff=LemonTree merge=LemonTree binary

Depending on the different EA project file formats that you want to use, you have to add those file endings as well to the .gitattributes (also keep in mind that the file extensions are case-sensitive). For all supported EA project types, the .gitattributes file would look like this:

*.eap filter=lfs diff=LemonTree merge=LemonTree binary
*.eapx  filter=lfs diff=LemonTree merge=LemonTree binary
*.EAP   filter=lfs diff=LemonTree merge=LemonTree binary
*.EAPX  filter=lfs diff=LemonTree merge=LemonTree binary

If you are using a repository, that didn't have LFS enabled and you created branches at that time, make sure that all branches you want to diff / merge use the same .gitattributes file, with the required entries as listed above.

Note that this only works because we're using the LemonTree Starter as the merge driver. The starter takes over the functionality normally carried out by Git LFS (the inflating of the LFS pointer files).

And, done! LemonTree is now registered as a merge driver, and configured to be used for eap files in the repository. You can now add an eap file, branch out two branches, make modifications (conflicting or otherwise) and later when merging, LemonTree will be used to merge the files.

2. Setting up manual merging

When you want to manually merge, or resolve conflicts later on (without using automatic merging, or when automatic merging somehow fails), you can add lemontree as a mergetool:

Windows Command Prompt

git config --global merge.tool lemontree
git config --global mergetool.lemontree.cmd "'C:/Program Files/LieberLieber/LemonTree/LemonTree.Starter.exe' merge --base=\"$BASE\" --mine=\"$LOCAL\" --theirs=\"$REMOTE\" --out=\"$MERGED\""

Git Bash

git config --global merge.tool lemontree
git config --global mergetool.lemontree.cmd "'C:/Program Files/LieberLieber/LemonTree/LemonTree.Starter.exe' merge --base=\"\$BASE\" --mine=\"\$LOCAL\" --theirs=\"\$REMOTE\" --out=\"\$MERGED\""

Now you can resolve merge conflicts with LemonTree, for example by calling git mergetool someFile.eap or using some other UI for git.

This configures LemonTree to be the mergetool for everything in git. It doesn't discriminate between different filetypes. You can select the mergetool used for git mergetool by using the -t flag: git mergetool -t lemontree ... Also note that standard text merges won't be affected, as they are using the merge driver and built in merging of git.

3. Setting up diffing

To use LemonTree as a diff tool, do the following:

Windows Command Prompt

git config --global diff.tool lemontree
git config --global difftool.lemontree.cmd "'C:/Program Files/LieberLieber/LemonTree/LemonTree.Starter.exe' diff --base=\"$REMOTE\" --mine=\"$LOCAL\" --theirs=\"$REMOTE\""

Git Bash

git config --global diff.tool lemontree
git config --global difftool.lemontree.cmd "'C:/Program Files/LieberLieber/LemonTree/LemonTree.Starter.exe' diff --base=\"\$REMOTE\" --mine=\"\$LOCAL\" --theirs=\"\$REMOTE\""

Now you can use LemonTree to diff two versions in your git repository.

This configures LemonTree to be the difftool for everything in git. It doesn't discriminate between different filetypes. You can select the difftool used for "git difftool" by using the -t flag: "git difftool -t lemontree ..." Also note that standard text diffs won't be affected, as they are using the built in text diff of git.