Hey folks!

I’m fairly new to Unreal, let alone setting up an Unreal 5 project on version control for a team. We use Git for our version control, so obviously we gotta make sure we have certain things filled out in our .gitignore and .gitattributes (for Git LFS).

What do you normally have filled out in your ignore and attributes files for a typical Unreal 5 project?

Thanks!

  • r3D
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    1 year ago

    Take a look at the plugin maintained by the Project Borealis developers:

    https://github.com/ProjectBorealis/UEGitPlugin

    It’s a refactoring of the more popular ‘Git LFS 2’ plugin by Sébastien Rombauts (who now works at Unity on PlasticSCM) and has more development activity.

    I think Git LFS itself works fine. I use it for a repository with ~150 GiB of assets and ~10,000 commits. The performance is great and for source code heavy projects I think it’s fantastic.

    The problem is with the file locking support in Git LFS. The more robust implementation was never implemented ( https://github.com/git-lfs/git-lfs/issues/1844 ), and the PB plugin implements some of the features described there, but it’s still lacking in some ways.

    The locking API is essentially unable to do anything beyond:

    1. Check if a path is locked.
    2. Check who the owner of the lock is and allow the owner (or repo maintainer) to unlock it.

    It has no awareness of branches of any kind.

    Without the plugin you cannot ensure that people won’t modify stale versions of assets, and you cannot ensure that a user will not unlock an asset before they’ve pushed it upstream, creating a similar issue of another user locking and modifying a stale version of the asset, even if the prior user had locked it at some point. I would enforce a policy of “only unlock after push” to mitigate these issues, and only unlock once the asset is pushed to a branch that’s tracked by the plugin. If you do that, users won’t be able to lock and, depending on your editor config, modify the asset until they have the latest version of it.

    Anyway, Steve Streeting has a good post on this. He uses the above plugin and was actually involved with Git LFS itself (as well as having written Ogre3D and the SourceTree Git GUI client*):

    https://www.stevestreeting.com/2020/08/09/my-unreal-engine-vcs-setup-gitea-git-lfs-locking/

    *Atlassian has left SourceTree to rot after he left, so check out a better Git GUI client like ‘Git Fork’. $50, but it has an unlimited free trial.

    EDIT: As for your original question… in addition to Steve’s post, check out the .gitignore and .gitattributes configuration Project Borealis use (though their project is 4.27.2 iirc - it should be very similar to what you want):

    https://github.com/ProjectBorealis/PBCore/tree/main

    • Brody Brooks@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Wow, thank you for the detailed response! I’ll take a good look at their Git plugin, as file locking is something I really, really miss from Perforce since going to Git full time.

  • snoweA
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    I know next to nothing about game dev, but I thought it was pretty much unheard of to use git for game dev. I thought almost every game dev company uses perforce.

    • Brody Brooks@lemmy.worldOP
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Git has a plugin very commonly used now called Git LFS (Large File Support) that resolves the issues with using large, binary files. I’ve used it for years on Unity projects, and it works really well!

      BUT! Before you start committing a ton of files, you need to tell your git repo (via a .gitattributes) which file extensions or specific files you want to be placed in the Large File storage versus the regular git repo.

      • snoweA
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        Yeah I’ve used Git LFS before, but have also read (on reddit, so not sure I’d be able to link it), that Git LFS doesn’t work very well for the kinds of binary files you deal with in game dev. Anyway, I’m not a game dev, so don’t listen to me lol