Allow installations from git+file:// if the package is private

Throw error, in case packages are going to be published
See #3868