# Some feedback on Package Manager git support

**URL:** https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889
**Category:** Package Manager
**Tags:** Package-Manager, Feedback
**Created:** [September 11, 2019, 3:34pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889 "2019-09-11T15:34:52Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![TheValar](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/thevalar/32/243739_2.png) [@TheValar](https://discussions.unity.com/u/TheValar)
#### Post date: [September 11, 2019, 3:34pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/1 "2019-09-11T15:34:52Z")

</div>

Spent some time this week experimenting with making my own packages as git repos hosted on gitlab. Overall it is promising but there were a few pain areas that I just wanted to report my feedback on.

**Project Structure:**  
currently your package folder has to be the root of your repository which makes it kind of awkward to develop. Ideally you will be developing your package inside of a Unity project so assuming you want that project to be in git as well the only solution is workarounds involving sub modules or sub trees. It works fine but I feel like there could be a more convenient solution

**Versioning Support:**  
currently there is no official support for package versions or updating your packages. This is a pretty important feature. You can work around it by manually editing the json but I think this needs to be supported in the package manager ui

**Dependencies:**  
this is by far the most glaring deficiency. there really needs to be a way to make git hosted packages dependent upon other git hosted packages.

I really like the idea of the package system and think this could be the future of unity assets, particularly open source ones distributed outside of the asset store so I hope you continue to work on custom package support.

---

<div class="post-metadata">

### Author: ![Lobolopez](https://avatars.discourse-cdn.com/v4/letter/l/57b2e6/32.png) [@Lobolopez](https://discussions.unity.com/u/Lobolopez)
#### Post date: [September 16, 2019, 7:36am UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/2 "2019-09-16T07:36:23Z")

</div>

Totally agree on those points (particularly hooking a package to a Git subdir would be excellent for a lot of reasons)  
Recursive as it might sound… maybe if those things get to a testable stage it would be possible to release a packaged version with updates to the package manager without having to jump Unity versions…?

---

<div class="post-metadata">

### Author: ![samuelb\_unity](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@samuelb\_unity](https://discussions.unity.com/u/samuelb_unity)
#### Post date: [September 17, 2019, 7:00pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/3 "2019-09-17T19:00:12Z")

</div>

Hi @TheValar ,

Thank you for the great feedback! We take this all onboard and are currently working on the issues you raised. Can’t go into much more detail than that for now, sorry!

---

<div class="post-metadata">

### Author: ![Lobolopez](https://avatars.discourse-cdn.com/v4/letter/l/57b2e6/32.png) [@Lobolopez](https://discussions.unity.com/u/Lobolopez)
#### Post date: [January 30, 2020, 12:00pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/4 "2020-01-30T12:00:06Z")

</div>

I am wondering if you had any updates of those questions and also, if not, where would it be the right place to check that some of those questions have been addressed? Is there a good way to track down package-manager-related development?  
I am thinking, specially, on the “project structure” part of the conversion, being able to hook to a subdir of a repo (rather than the root) would be extremely helpful for us. I can see how a lone dev might not have that much of an issue, but when several people develop a single package and they need a reference project for testing and the like it does get complicated (and there are no good solutions for that: two repos? messy, single repo + split? breaks down, soft links? need to be replicated by hand (particularly tricky in multiple dev platform setups) etc, etc)  
So, assuming that one feature is still on the way, how could I check that it’s made it without bugging you guys? ;D

---

<div class="post-metadata">

### Author: ![Jichaels](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jichaels/32/199578_2.png) [@Jichaels](https://discussions.unity.com/u/Jichaels)
#### Post date: [January 30, 2020, 1:36pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/5 "2020-01-30T13:36:28Z")

</div>

On the release note of the new 2020 alpha, there is this line at the very end :

Package Manager: Added support for a Git package to be located in a repository sub-folder.

Any doc on that ?

---

<div class="post-metadata">

### Author: ![okcompute\_unity](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/okcompute_unity/32/44211_2.png) [@okcompute\_unity](https://discussions.unity.com/u/okcompute_unity)
#### Post date: [January 30, 2020, 2:51pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/6 "2020-01-30T14:51:05Z")

</div>

Hi @Jichaels ,

The documentation is in the work. Here is the draft that I sent to the technical writer:

* * *

**Path query parameter (Subfolder)**  
You can specify a repository subfolder for a Git package through the `path` query parameter. The Package manager will only register the package located in the specified repository subfolder and disregard the rest of the repository.

_This feature was introduced in Unity 2020.1.a21_

Special considerations:

- `path` must be a relative path to the root of the repository. An absolute path won’t work. (ex: `path=c:\my\repo\subfolder` is ❌, `path=/subfolder` is ✅)
- … and . indirection notation is supported but will block at the repository root (i.e. /…/…/… will resolve to / )
- `path` query parameter **must** be placed **before** the revision anchor. The reverse order will fail.
- A package manifest (package.json) is expected in the specified path.

Examples:

**Path query parameter**

`https://github.com/user/repo.git?path=/example/folder`

**Revision anchor and path query parameter**  
`https://github.com/user/repo.git?path=/example/folder#v1.2.3`

**Two packages from the same repository**

`https://github.com/user/repo.git?path=/packageA``````https://github.com/user/repo.git?path=/packageB`

* * *

I hope it helps! And please, let us know if there are any issues.

Regards,

Pascal

---

<div class="post-metadata">

### Author: ![Jichaels](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jichaels/32/199578_2.png) [@Jichaels](https://discussions.unity.com/u/Jichaels)
#### Post date: [February 3, 2020, 9:52am UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/7 "2020-02-03T09:52:10Z")

</div>

Super cool, thanks !

Does that allow us to have dependencies of other subfolder as package dependencies ?

Like in the package.json of `https://github.com/user/repo.git?path=/packageA`

can I have `https://github.com/user/repo.git?path=/packageB`

And more importantly, is the “multiple version” (like all the unity package, having the versions available and being able to hit “update” if there is a newer version according to SemVer) support coming ? Is there an ETA on that ?

Thanks a lot !

---

<div class="post-metadata">

### Author: ![okcompute\_unity](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/okcompute_unity/32/44211_2.png) [@okcompute\_unity](https://discussions.unity.com/u/okcompute_unity)
#### Post date: [February 3, 2020, 12:23pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/8 "2020-02-03T12:23:23Z")

</div>

> [@Jichaels](#):
>
> Does that allow us to have dependencies of other subfolder as package dependencies ?

Not yet. But something we plan to support at some point. No ETA. Sorry.

> [@Jichaels](#):
>
> aving the versions available and being able to hit “update” if there is a newer version according to SemVer

This is not something we are planning to implement.

Regards,

Pascal

---

<div class="post-metadata">

### Author: ![Jichaels](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jichaels/32/199578_2.png) [@Jichaels](https://discussions.unity.com/u/Jichaels)
#### Post date: [February 3, 2020, 1:49pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/9 "2020-02-03T13:49:12Z")

</div>

> [@okcompute\_unity](#):
>
> Not yet. But something we plan to support at some point. No ETA. Sorry.

Ok cool, because currently I have to manually add packages in order, or I get errors, which is pretty bad for users.

> [@okcompute\_unity](#):
>
> This is not something we are planning to implement.

Really ? Isn’t it already implemented ? Because it’s how it works with all unity packages, and it would be really cool to have for us aswell ☹  
Maybe not the “select your version from all available”, but at least being able to upgrade with a button on the package manager. Having to delete the lock and all that is extremely not user-friendly, and a normal thing to have for managing packages 😕

---

<div class="post-metadata">

### Author: ![okcompute\_unity](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/okcompute_unity/32/44211_2.png) [@okcompute\_unity](https://discussions.unity.com/u/okcompute_unity)
#### Post date: [February 3, 2020, 2:30pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/10 "2020-02-03T14:30:15Z")

</div>

> [@Jichaels](#):
>
> but at least being able to upgrade with a button on the package manager. Having to delete the lock and all that is extremely not user-friendly, and a normal thing to have for managing packages 😕

Oh, yes! That we definitely want to support. My answer was about implementing a Git client in the Package Manager UI to enable listing branches, tags, and parse package versions, etc.. This we don’t have plans to do.

---

<div class="post-metadata">

### Author: ![Jichaels](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jichaels/32/199578_2.png) [@Jichaels](https://discussions.unity.com/u/Jichaels)
#### Post date: [February 4, 2020, 8:23am UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/11 "2020-02-04T08:23:09Z")

</div>

> [@okcompute\_unity](#):
>
> Oh, yes! That we definitely want to support. My answer was about implementing a Git client in the Package Manager UI to enable listing branches, tags, and parse package versions, etc… This we don’t have plans to do.

Ok fair enough ! Having dependencies and upgrade is fine to me !

---

<div class="post-metadata">

### Author: ![Jichaels](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jichaels/32/199578_2.png) [@Jichaels](https://discussions.unity.com/u/Jichaels)
#### Post date: [February 4, 2020, 3:14pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/12 "2020-02-04T15:14:58Z")

</div>

Ok, so I’ve been trying things today :

- On the input field “Add from git URL…”, I cannot type “#” (but I can paste it).

- I made a github action file that will split a repo containing multiple packages to branches, that you can get with [https://github.com/YourUserName/MainRepoName.git#PackageName](https://github.com/YourUserName/MainRepoName.git#PackageName) and will also rename “Samples” to “Samples~” and “Documentation” to “Documentation~” so you work on your project with everything, but it’s fine in the git packages  
Your main repo need to be structured like this :

```csharp
MainRepo
  - Package1
  - Package2
  - ...

```

Here is the github action :

```auto
name: Create package branches
on:
  push:
    branches:
    - master

jobs:
  rename_samples:
    name: Create branches
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |
          for i in `ls -d */`; do
            git checkout master
            branch=${i::-1}
            if [`git branch --list $branch`]; then
              git branch -d $branch
            fi;
            git subtree split -P $branch -b $branch
            git checkout $branch
            git config --global user.name 'github-bot'
            git config --global user.email 'github-bot@users.noreply.github.com'
            if [[-d "Samples"]]; then
              git mv Samples Samples~
              rm -f Samples.meta
              git commit -am "rename: Samples => Samples~"
              git push -f -u origin $branch
            else
              echo "${i}Samples does not exist"
            fi
            if [[-d "Documentation"]]; then
              git mv Documentation Documentation~
              rm -f Documentation.meta
              git commit -am "rename: Documentation => Documentation~"
              git push -f -u origin $branch
            else
              echo "${i}Documentation does not exist"
            fi
          done;
```

It’s probably not perfect, but it’s fine for what I wanted ! 🙂 (and way easier to work with than working in the Packages/ folder of unity

---

<div class="post-metadata">

### Author: ![Lobolopez](https://avatars.discourse-cdn.com/v4/letter/l/57b2e6/32.png) [@Lobolopez](https://discussions.unity.com/u/Lobolopez)
#### Post date: [February 5, 2020, 2:04pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/13 "2020-02-05T14:04:09Z")

</div>

> [@okcompute\_unity](#):
>
> Hi @Jichaels ,
> 
> The documentation is in the work. Here is the draft that I sent to the technical writer:
> 
> * * *
> 
> **Path query parameter (Subfolder)**  
> You can specify a repository subfolder for a Git package through the `path` query parameter. The Package manager will only register the package located in the specified repository subfolder and disregard the rest of the repository.
> 
> _This feature was introduced in Unity 2020.1.a21_
> 
> Special considerations:
> 
> - `path` must be a relative path to the root of the repository. An absolute path won’t work. (ex: `path=c:\my\repo\subfolder` is ❌, `path=/subfolder` is ✅)
> - … and . indirection notation is supported but will block at the repository root (i.e. /…/…/… will resolve to / )
> - `path` query parameter **must** be placed **before** the revision anchor. The reverse order will fail.
> - A package manifest (package.json) is expected in the specified path.
> 
> Examples:
> 
> **Path query parameter**
> 
> `https://github.com/user/repo.git?path=/example/folder`
> 
> **Revision anchor and path query parameter**  
> `https://github.com/user/repo.git?path=/example/folder#v1.2.3`
> 
> **Two packages from the same repository**
> 
> `https://github.com/user/repo.git?path=/packageA``````https://github.com/user/repo.git?path=/packageB`
> 
> * * *
> 
> I hope it helps! And please, let us know if there are any issues.
> 
> Regards,
> 
> Pascal

First, that’s fantastic!  
Second… is there a way to get that through updating the package manager itself? I could use this yesterday but won’t be able to migrate our Unity to 2020 in, well, quite a while. It would be incredibly useful if stuff like this could be cherry picked!

---

<div class="post-metadata">

### Author: ![okcompute\_unity](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/okcompute_unity/32/44211_2.png) [@okcompute\_unity](https://discussions.unity.com/u/okcompute_unity)
#### Post date: [February 6, 2020, 6:48pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/14 "2020-02-06T18:48:04Z")

</div>

> [@Lobolopez](#):
>
> It would be incredibly useful if stuff like this could be cherry picked!

We are looking into backporting this feature in 19.3 (finger crossed)

---

<div class="post-metadata">

### Author: ![okcompute\_unity](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/okcompute_unity/32/44211_2.png) [@okcompute\_unity](https://discussions.unity.com/u/okcompute_unity)
#### Post date: [February 6, 2020, 6:50pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/15 "2020-02-06T18:50:53Z")

</div>

> [@Jichaels](#):
>
> On the input field “Add from git URL…”, I cannot type “#” (but I can paste it).

That is a bug. I will report to the team but it would be even better if you could report [an official bug too](https://unity3d.com/unity/qa/bug-reporting).

Thank you!

---

<div class="post-metadata">

### Author: ![xucian](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/xucian/32/348103_2.png) [@xucian](https://discussions.unity.com/u/xucian)
#### Post date: [February 6, 2020, 6:55pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/16 "2020-02-06T18:55:12Z")

</div>

> [@okcompute\_unity](#):
>
> We are looking into backporting this feature in 19.3 (finger crossed)

+1  
It’ll be of great help, as most people will probably use 2019 for 1-2 more years

---

<div class="post-metadata">

### Author: ![ethan\_jl\_unity](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@ethan\_jl\_unity](https://discussions.unity.com/u/ethan_jl_unity)
#### Post date: [February 6, 2020, 7:25pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/17 "2020-02-06T19:25:23Z")

</div>

> [@Jichaels](#):
>
> Ok, so I’ve been trying things today :
> 
> - On the input field “Add from git URL…”, I cannot type “#” (but I can paste it).

Which Unity version are you using? I just tired locally on Windows and Mac and everything seems to be working fine.

---

<div class="post-metadata">

### Author: ![Jichaels](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jichaels/32/199578_2.png) [@Jichaels](https://discussions.unity.com/u/Jichaels)
#### Post date: [February 11, 2020, 8:24am UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/18 "2020-02-11T08:24:50Z")

</div>

> [@ethan\_jl\_unity](#):
>
> Which Unity version are you using? I just tired locally on Windows and Mac and everything seems to be working fine.

2020.1.0a21.2690, using an AZERTY keyboard, Win10

---

<div class="post-metadata">

### Author: ![Vusa360](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@Vusa360](https://discussions.unity.com/u/Vusa360)
#### Post date: [March 5, 2020, 10:32am UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/19 "2020-03-05T10:32:30Z")

</div>

> [@okcompute\_unity](#):
>
> We are looking into backporting this feature in 19.3 (finger crossed)

Is this something that is likely to happen?

---

<div class="post-metadata">

### Author: ![supita\_unity](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@supita\_unity](https://discussions.unity.com/u/supita_unity)
#### Post date: [March 5, 2020, 2:53pm UTC](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889/20 "2020-03-05T14:53:30Z")

</div>

> [@Vusa360](#):
>
> Is this something that is likely to happen?

Yes! 🙂 The packport is already done, the support for Git packages on repository sub-folders will be in the upcoming Unity 2019.3.4f1

[Next page](https://discussions.unity.com/t/some-feedback-on-package-manager-git-support/757889.md?page=2)
