Skip to content
Simeon Radivoev edited this page Sep 15, 2019 · 11 revisions

Contents

Most settings, buttons or fields have tooltips that explain their function. Just hover over them in the Unity Editor to see information about them.

Configuration

If you put UniGit in an empty project, or a project that is not a Git repository, a notification will be shown on every UniGit window. The notification will allow you to Initialize a git repository or choose one that is not part of the root project. Note that UniGit copies a built-in .gitignore file that contains all the necessary Unity3D filters. The ignore file also ignores UniGit itself

Initialization Window

To choose a repository that is a subdirectory of the project just click the Find button when the initialization popup is displayed on each window or go into Git Settings in the General tab under the Git Settings category and hit the Select Main Repository Path button. That will prompt you to select a folder that will be the main git repository.

Select Main Repository Path

If you want to clone an existing repository, you will have to do so with an external tool. Unfortunately, this plugin requires Unity and changes to project setting or other files outside unity may not be allowed.

Remotes

Once you initialize a repository a master branch will be created. If you want to assign a remote to this branch, you must create one first.
In the settings menu open the remotes tab, there you can add a new repository and assign its URL and Name. Once the repository is created you can head over to the Branches tab in the settings window. There you can assign a remote to your new master branch, or any other branch in your repository.
Once you push/fetch changes to/from your remote repository a new branch will appear, Called (remote name)/(branch name) - substitute (remote name) with your remote name and (branch name) with your branch name.

Credentials

UniGit has its own Credentials manager. This manager is entirely optional, but if used will allow you to automatically fetch changes from remotes. It uses Windows Data Protection API (DPAPI) to encrypt passwords.

The Git Credentials Manager only works in Windows

To add a credential go to the Security tab in the settings window. Once you create a credential you can name it, assign a URL (usually the path to your remote repository), add a username and/or change a password.
GitHub tokens are also supported.

It is important to not include the Git-Credentials.asset file to your repository, especially if you use a GitHub token. This is the file that your encrypted passwords are used. If you do include this file, the Windows Data Protection API should help protect the encrypted password as it can only be decrypted by your Windows user.

If you don't want you to use the credentials manager you can always type your password manually when you push or fetch changes.

Git Settings

Git has a lot of settings. Documentation for all Git settings can be found here. UniGit includes some of the basic settings, like:

  • User.Name The Name of the user
  • User.Email The email of the user

You can find these settings in the General tab in the settings window. You can also manually edit the local config file .git/config.

UniGit Settings

  • AutoStage this options allows for automatic staging of changed files. Staging the changes ready for committing.
  • AutoFetch allows for automatic fetching of changes from remote repository. This will notify you of any changes made to the remote repository. Note that if the changes are quite big, the fetching process might take some time, as fetching download all changes but does not merge them.
  • Show Empty Folders should empty folders and their .meta files are shown in the Diff Window
  • Project Status Overlay Depth This option governs the depth at which folders show changes in them if they are not expanded in the project browser. The default depth is 2, that means a folder will show changes up to 2 folders deep.
  • 'Use Threading' places where multithreading should be used
    • Stage multithreading when staging changes to working tree
    • Unstage multithreading when unstaging changes from working tree
    • Status multithreading when retrieving the status of files from Git and caching it
    • StatusListGui multithreading when constructing the list of changes in the Diff Window
    • CommitListGui multithreading when retrieving the commit history from Git in the Diff History Window
  • Use Gavatar should avatars be downloaded from Gavatar using the git email of the committer
  • Detect Renames will allow the detection of renames and moving of files in preview. Note that detect renames don't work with lazy update mode properly in preview, altho git will still detect renames internally. If using Lazy Update Mode a manual reload in the Diff Window is required to detect and show renames.
  • Use Simple Context Menus controls if the context menu for the Diff Window will be the custom one with icons and animations or the default unity one
  • Lazy Update Mode Without lazy mode, git status is updated on each assembly reload. That means each time scripts are re-compiled and when leaving or entering play mode
  • Track System Files will allow Unity to detect changes for files that are outside the Assets folder.
  • Use Unity's Console will disable the UniGit log window and will output any notifications, errors, and warnings into Unity's console
  • Create Missing Meta Folders Create Missing Folders for .meta files. If a .meta file is committed for an empty folder, once the change is pulled then Unity will delete the .meta file and the folder will not be created. This option creates the folder so that Unity doesn't destroy the .meta files.

External Programs

UniGit provides the use for External Programs for tasks like pushing, pulling, fetching, merging, committing and others. You can choose your external program and when to use it in the Externals tab in Git Settings.

Programs that work with UniGit:

  • TrotoiseGit
  • Git Extensions

Credential Managers

Many operations that connect to a remote repository, like pulling, pushing and fetching require some form of credentials. UniGit allows for direct input of username and password each time you do an operation.

UniGit has its own credential manager, that uses Windows Data Protection API (DPAPI) to encrypt passwords, but also allows for external Credential Managers. Managers that work with UniGit include:

  • Windows Credentials Manager (Windows 7/8/10)

To choose your credentials manager just head over to the Security tab in the settings window. Note that if you change credential managers your old passwords will be lost, even if you used the inbuilt credential manager.

Git LFS

Note that Git LFS with inbuilt tools is still in beta. It is recommended you use External tools when pushing, pulling, fetching or merging.

Git Large File Storage will work out of the box while using external tools. If using inbuilt tools then you need to set up a credential manager like Windows Credentials Manager os that Git LFS has access to your credentials when pulling and push

Clone this wiki locally