The Package Manager can load a package from a Git repository on a remote server.
For more information about using Git URLs with the Unity Package Manager, see the documentation on using Git URLs in your project manifestEach Unity Project has a Project manifest, which acts as an entry point for the Package Manager. This file must be available in the
<project>/Packages directory. The Package Manager uses it to configure many things, including a list of dependencies for that Project, as well as any package repository to query for packages. More info
See in Glossary.
To load a package from a Git URL:
Click the add button in the status bar.
The options for adding packages appear.
Select Add package from git URL from the add menu. A text box and an Add button appear.
Enter a valid Git URL in the text box and click Add.
For more information about what protocols Unity supports, see Git URLs.
If Unity was able to install the package successfully, the package now appears in the package list with the git tag.
If you specify a location that does not exist, a message similar to this one appears in the Unity Console:
Cannot perform upm operation: Unable to add package [https://mycompany.github.com/gitproject/com.mycompany.mypackage.git]: Error when executing git command. fatal: repository 'https://mycompany.github.com/gitproject/com.mycompany.mypackage.git/' not found [NotFound] UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)
Check your spelling. To make sure you are using the correct URL, go to the repository’s page and copy the URL from the Clone button:
Click the button to the right of the URL on GitHub (A) or GitLab (B) to copy the URL to your clipboard.
If you are trying to install a package from a private repository that requires authentication, a message similar to this one appears in the Unity Console:
Cannot perform upm operation: Unable to add package [https://mycompany.github.com/gitproject/com.mycompany.mypackage.git]: Error when executing git command. fatal: could not read Username for 'https://mycompany.github.com': terminal prompts disabled [NotFound] UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)
The two most common protocols for authentication while cloning or fetching Git repositories are HTTP(S) and SSH (that is, a pair of public and private SSH keys):
With HTTP(S), every time you log onto GitHub or GitLab you need to enter your username and password in a terminal or a dialog box.
However, if you have set up a passphrase to keep your SSH key safe, you still have to enter that passphrase in a terminal or a dialog box in order to authorize your key.
For an overview of the difference between the protocols that Git uses, see the Git documentation for using protocols.
The Package Manager does not provide an interactive terminal or dialog where you can enter your username and password for HTTP, or your passphrase to unlock your SSH key. To bypass this, use one of these workarounds: