Private Repo specific branch/commit access as dependency for another private repo

We have a private GitLab server deployed (let’s say: http://mygitlab.com) and in there I have 2 private projects say project_A (http://mygitlab.com/fuji/project_A) and project_B (http://mygitlab.com/fuji/project_B).
Now project_A has a dependency on project_B (in package.json). I want project_B’s specific branch/commit to be added as a dependency in project_A and how can I do that? will it be different for the HTTPS server?

I tried this locally and failed:
in project_A’s package.json,
"my_dependency":"http://mygitlab.com/fuji/project_B#specificCommit"
(where this commit is from different branch and my git console was trying to find this commit in master branch)
What should I do ? and thanks in advance for any help…! :heartbeat: