SRombauts / UEGitPlugin

Unreal Engine 5 Git LFS 2 Source Control Plugin (beta)
http://srombauts.github.io/UEGitPlugin
MIT License
808 stars 165 forks source link

Git LFS conflict resolution? #47

Open SRombauts opened 6 years ago

SRombauts commented 6 years ago

Answerhub Git LFS Conflict Resolution

Does the git plugin works for conflicts on Blueprints tracked by Git LFS?

SRombauts commented 6 years ago

How to solve a merge conflict:

  1. When you "merge" two branches where a BP was modified on both branches, git mark binary files as in conflict
  2. The Editor shows a special "!" icon
  3. Click to open the UE Merge tool, that will display diffs (read-only)
  4. Choose the side you want to keep (one side will crash the editor, there was an recent question about it) (issue #46)
SRombauts commented 6 years ago

@brusiks said in #48 Git LFS conflict resolution not working:

Engine can't read uasset file if it is in a conflict state after merging branches. Because of GIT LFS there is not binary content of the uasset files and resolving of the conflict is not possible.

ccarvalheiro commented 4 years ago

This is caused by the default merge driver for git lfs, it can be easily fixed by changing the merge driver to the git's default for binary files.

So, in a typical .gitattributes file we would have the entry for .uasset files similar to:

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

We change the merge driver to binary like so:

*.uasset filter=lfs diff=lfs merge=binary -text

That will make git choose the current version of the conflicting file (ref) and which will allow UE4 merge tool to work correctly.

We could improve the plugin in two ways:

  1. Detect when the driver is misconfigured and log;
  2. Add a way to automatically fix/replace the driver in .gitattributes

What do you think?

I will try to implement at least the first one.

SRombauts commented 4 years ago

Yes, very good to know indeed, thank you!