Workflow of using git

I want to use git for my project.
Many file types are used in Unreal Engine projects, but most of them are not text files, such as blueprint files. We cannot see changes which were done in editor for blueprints.

What is the best workflow of using git for these files? How do you work in case when you want to see changes since last commit? (Changes between two commits).

Two possible ways:

  1. Create a copy of blueprint with some suffix and modify this copy. Delete the older version of file from project when work is done.

  2. Create branch and make changes in it. If I want to see changes I need to switch branch.

Do you have any opinions, any advises? How do you work with git?

Disclaimer: We’re using SVN rather than Git, but I think the basic problems are the same.

There’s a Source Control system integrated in the Unreal editor.

It has some problems [1] but for the Blueprint diffs alone it’s absolutely worth setting it up. When attempting to Connect to Source Control the options given are Perforce, Subversion and Git, though at least in version 4.8 the latter is still in beta version.

Once you’ve got the integrated source control set up, you can right click on any Blueprint asset to compare it to the repository version (Diff against depot) and also compare previous versions in the history. Though it’s still a bit unstable (prone to crashes), this diff tool is rather powerful. You get a list of which nodes have been added, removed, moved or changed and by doubleclicking on any change can focus on the node in question within the Blueprints to compare the two versions.

There’s also a merge tool to handle conflicts, but at least for me it crashed about 90% of the time. And even if you can get it to work, it’s only an extended version of the Diff with a third column showing your current version, so you slowly copy and paste nodes until you’ve manually resolved the conflict.

[1] For example, I wouldn’t recommend to use the in-editor Sync ever because at least with SVN, the assets won’t get refreshed until the editor is next opened and conflicts are silently ignored, defaulting to the local version instead. As far as I know the same problem also exists for Perforce, so I’d be surprised if it worked for Git.

Even with having assets locked whenever one developer is working on it, I sometimes still have to make some changes to the same Blueprint, even if only to test changes made in another one. Personally, I deal with that by having two checkouts of the project. Once the Blueprint becomes free again, I can then manually transfer my changes (via copy and paste) from one checkout to the other one.