Skip to content

Improve your Unity project's Git integration, mostly for LFS locks

License

Notifications You must be signed in to change notification settings

mikerochip/unity-git-tools

Repository files navigation

Unity Git Tools

Unity Version

Improve your Unity project's Git integration with this package. Mostly helps you manage Git LFS Locks in the editor.

How to Use

  • Set your username for your hosting service (GitHub, GitLab, etc) in Preferences > Git
  • Open the Git LFS Locks UI with Window > Git > Locks
  • Right click on an asset in the Project tab to lock, unlock, or force unlock it

Samples

Locks Window

Without Lock ID With Lock ID

Raw output from command line

Branch name can be accessed with GitSettings.Branch

Showing it inside the toolbar is possible with the awesome unity-toolbar-extender:

using MikeSchweitzer.Git.Editor;
using UnityEditor;
using UnityEngine;
using UnityToolbarExtender;

namespace Editor
{
    [InitializeOnLoad]
    public static class Toolbar
    {
        static Toolbar()
        {
            var branchStyle = new GUIStyle
            {
                fontSize = 15,
                fontStyle = FontStyle.Bold,
                normal = new GUIStyleState
                {
                    textColor = new Color(0.1f, 0.8f, 1.0f),
                },
            };

            ToolbarExtender.LeftToolbarGUI.Add(() =>
            {
                GUILayout.Space(100.0f);
                EditorGUILayout.LabelField($"Branch: {GitSettings.Branch}", branchStyle);
                GUILayout.FlexibleSpace();
            });
        }
    }
}

About

Improve your Unity project's Git integration, mostly for LFS locks

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages