Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 2.08 KB

README.md

File metadata and controls

64 lines (48 loc) · 2.08 KB

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();
            });
        }
    }
}