Referring to packages stored in git repositories, PackageControl can only install packages that exist on GitHub or BitBucket and those repositories have to be publicly available; as far as I’m aware there is no facility to enter user credentials at all.
That said, you can distribute private packages without using Git by creating your own repository JSON file and having it serve sublime-package
files; note that here the name repository
refers to a repository of packages and not a git repository.
To do so you need to set up a web server that can serve files via https
and which is accessible to everyone who will install the packages. PackageControl will only handle files that are served over an https
connection.
The first step would be to create your sublime-package
files, which you can do via PackageControl itself by using the PackageControl: Create Package File
command from the command palette. The package_destination
and package_profiles
settings in the Package Control settings control how this works, but by default you can just pick the Default
profile when you’re prompted and the package file will appear on your desktop.
The next step is to create the repository JSON file, which would look something like the following (fill out the package fields as appropriate):
{
"schema_version": "3.0.0",
"packages": [
{
"name": "My Package Name",
"description": "My Package Description",
"homepage": "https://packagehomepage.com/",
"author": "youusernamehere",
"releases": [
{
"version": "1.0.0",
"url": "https://packagehomepage.com/PackageFile.sublime-package",
"date": "2019-05-28 21:33:25",
"sublime_text": ">=3126",
"platforms": ["*"]
}
]
}
]
}
To use it, you tell your users to select the Package Control: Add Repository
command from the command palette and enter the URL to the json
file that you created. Once that’s done, your packages will be offered along with all other packages when you use the Install Package
command.
When doing this, you’re responsible for updating the sublime-package
file and updating the information in the json
file to show a new version number and so on.
More information on this is in the PackageControl docs page and the links from that page (such as the example repository file shown there).