Giter Site home page Giter Site logo

mrtrizer / unitygitui Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 1.25 MB

Git UI for Unity with multi-repository support. Manage multiple repositories like it's one repo

License: GNU General Public License v3.0

C# 100.00%
git git-ui unity unity3d unity3d-plugin

unitygitui's Introduction

This package is provided "as is" without any warranty, and the author and contributors will not be liable for any damages arising from its use. Use at your own risk!

Installation

Tested with Git 2.38.1 + Unity 2021.3.10f1

  1. Install git client first https://git-scm.com/downloads. I also highly recommend installing GCM (should be installed automatically on Windows), it will show an auth window when you try to pull or push without authorization. Git should be added to PATH environment variable. Restart Unity and Unity Hub after you install Git and add it to PATH.
  2. Window -> Package Manager -> "+" -> Add package from git URL -> https://github.com/mrtrizer/MRUnityGitUI.git
  3. (Optional, Only Mac/Linux/Win on NTFS) You can link UnityGitUI without adding to manifest! Just right click on UnityGitUI in Project Browser -> Git -> Link Local Repo, it will suggest you clone the repo, click "Clone", after it will be linked to your Packages dir.

How to use

  1. Prepare layout. Window -> Git UI -> Select window you want -> Drag somewhere. Do this for every window.
  2. When you select Directory in Project Browser, the state of related git repo will be displayed in Git UI windows respectively.
  3. In the Branches window you can lock selected packages by clicking "Lock" button in the top panel, so, you won't need to select packages again, useful if you have tons of packages.
  4. Branches window also has a bottom panel with quick access buttons to Fetch/Pull/Push and Staging/Log/Stash
  5. Use Process Log window to see what actual commands does Unity Git UI run on your repo

That's how my layout looks: Screenshot

Features

The primary goal of this project is to optimize the workflow for both artists and programmers.

This tool is useful even if you have a single repository and use another GitUI alongside it. But it really shines when you have multiple repositories, submodules, own packages etc. It is designed with performance and extensibility in mind. This plugin does not rely on undocumented features (just a little, really), it's code is mostly straightforward.

Screenshot

Features for multiple repos

  • Manage branches, tags, and stash
  • Stage and Commit (additionally supports Amend)
  • Merge (choose theirs/mine)
  • View Diff
  • Hunk Stage/Unstage/Discard
  • Amend (author/message/content)
  • Fetch/Pull/Push
  • Git LFS (see files managed by lfs, view patterns and add new patterns)
  • Project Browser extension
    • Display current status of repositories, current branch, and remote status
    • Show file statuses and highlight directories containing modified files
    • Show LFS and submodule (only for packages) indicators
  • Link Package as a local repo (without manifest modification). Allows cloning the Git package and creating symbolic links to it. It uses junctions on Windows (works only with NTFS)

Features working only for selected repo

  • (WIP) View visual git log
  • Configure Remote settings
  • View Process Log, showing the exact git commands executed and their output
  • Stash
  • (WIP) Git Config (Change name and email globally or locally)
  • Remote Settings and multiple remotes support
  • Blame

Not implemented yet

  • Extentions support
  • Adding new commands without coding
  • Support for nested submodules
  • Support for LFS locks

unitygitui's People

Contributors

mrtrizer avatar jasursadikov avatar denis-zdorovtsov avatar ziller90 avatar

Stargazers

 avatar  avatar Mr.Hu avatar  avatar Anton Dyachenko avatar  avatar Ivan K. avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jasursadikov

unitygitui's Issues

Verbose Update window

You can make "Update" window more Verbose by adding GUILayout.VerticalSplitView() with stdout of git.

image

Review logic of GetIsGitRepo()

        async Task<bool> GetIsGitRepo()
        {
            var result = await RunGit("rev-parse --show-toplevel", true);
            if (result.ExitCode != 0 || string.IsNullOrEmpty(result.Output))
                return false;

            // This check doesn't cover cases where Assets dir is a git repo, or a project is within a bigger repo
            // I also got feedback that this code is hard to read, probably need to add a comment or refactor it
            return Path.GetFullPath(result.Output.Trim()) != Directory.GetCurrentDirectory() || Path.GetFullPath(PhysicalPath) == Path.GetFullPath(Application.dataPath);
        }

Stash didn't work for some reason

stash push -m "Fixes" -- "C:/Unity Projects/rtsgame/Assets/Assets/Config/IconsMap.asset" "C:/Unity Projects/rtsgame/Assets/Assets/Materials/DragonFireMaterial.mat" "C:/Unity Projects/rtsgame/Assets/Assets/Materials/DragonFireMaterial.mat.meta" "C:/Unity Projects/rtsgame/Assets/Assets/Materials/Dungeons_Texture_01.png" "C:/Unity Projects/rtsgame/Assets/Assets/Materials/Dungeons_Texture_01.png.meta" "C:/Unity Projects/rtsgame/Assets/Assets/Materials/PoisonMaterial 1.mat" "C:/Unity Projects/rtsgame/Assets/Assets/Materials/PoisonMaterial 1.mat.meta" "C:/Unity Projects/rtsgame/Assets/Assets/Prefabs/Projectiles/DragonFireProjectile.prefab" "C:/Unity Projects/rtsgame/Assets/Assets/Prefabs/Projectiles/PoisonProjectile.prefab" "C:/Unity Projects/rtsgame/Assets/Scripts/Runtime/ActorModels/IDamageReceiver.cs" "C:/Unity Projects/rtsgame/Assets/Scripts/Runtime/PoisonDisapearingView.cs" "C:/Unity Projects/rtsgame/Assets/Scripts/Runtime/PoisonInHandView.cs" "C:/Unity Projects/rtsgame/Assets/Scripts/Runtime/PoisonInHandView.cs.meta" "C:/Unity Projects/rtsgame/Assets/Scripts/Runtime/SceneVisuals/UnitView.cs" "C:/Unity Projects/rtsgame/ProjectSettings/Packages/com.unity.services.core/Settings.json"

Stash changes, not files

Currently, when you are doing stash, unstaged changes get into stash if some changes of the file are stashed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.