Check out tagged commit of unregistered package




the title pretty much says it all. I have an unregistered package not ready for being published and would still like to be able to install specific versions using tags.

I know I could use branches via Pkg.checkout("MyPackage", branch = "0.0.1") but that is rather hackish as the ‘real’ versioning system relies on tags.

So, after cloning my package, how do I install a tagged version/release?




I don’t know how to do it in the Julia REPL, but at the command-line (in the directory of the project): git checkout 0.0.1


sure, but I was hoping for a method via - should be possible, should it not?


You should be able to hack something together by calling git with the working directory Pkg.dir(...). Or even using the built-in libgit: see the sources of Pkg.checkout and Entry.checkout.


Both tags and branches are just references to particular git commits, so I don’t think there’s any difference.

You should just be able to write

Pkg.checkout(“package”, “v0. 0.1”)

I believe.


I am not familiar with LibGit2 internals, but I don’t think it will be that easy (source).


Thanks for the suggestions, what finally worked for me is:

Pkg.checkout("MySuperPackage", "master@v0.0.1")


Okay, that was premature x)

Somehow, in the process of fiddling with Pkg.checkout(), a new branch master@v0.0.1 was created - and that could be checked out. So this doe not actually solve the problem x). As mentioned earlier, one can use git directly to checkout the tag, but that requires potential users to interact with git directly.

It would be just really cool, if the package system would treat unregistered packages as first-class as well. I really do not want to register my package yet, as I feel that it is very specific and should undergo further testing etc. before being of much interest to others. But it should still be possible to checkout a specific prior release (tag) without fiddling around too much, should it not?


Didn’t @dpsanders’s suggestion work? You don’t need to specify master@, tags exist independently of any branches (that would be the same with the command-line git).


Nope, Error: “There is no tracking information for the current branch”. It does checkout a (new) branch “v0.1.0” though but I would rather not recommend a command which produces an error :wink:


I used v0.1.0 (with a v) because that is the Julia convention for tags that is required for the package manager. But if your tag is named 0.1.0 (without a v) then that’s what you should put in the checkout command.


yeah, I did (and I did tag it as v0.1.0 to be consistent with the Julia naming convention and to not get in trouble when publishing later)