Tracking a 'project environment' including a ./dev sub-directory on Git

I would like to be able to have a project evironment where I can call

  1. pkg> activate . in the top level to maintain environment for messing with stuff.
  2. pkg> develop --local some package to work on whatever features needed

I want to create a git repository for the top level that also includes any local package repositories in ./dev. What is the best way to do this?

Probably pkg> generate and git init (from the shell) would be enough, but I would recommend a package template generator.

1 Like

If I understand the question correctly, one solution is to keep the ./dev packages as Git submodules and make sure the top level project’s Manifest.toml file (which points to the ./dev paths) is checked in to the repo. Install instructions for your package are then,

$ git clone --recursive https://github.com/user/MyToplevelPackage.jl
$ cd MyToplevelPackage.jl
$ julia --project=.
pkg> instantiate
julia> using MyToplevelPackage

This is a good solution for personal-ish use (I use it all the time and it works well), but won’t let anyone install your package via Julia’s pkg> add. If you want that, then all your package’s dependencies, including the stuff you were keeping in ./dev, need to be registered. Note that if you don’t want to register things in the general registry, it is also possible to keep a personal registry on Github (can’t speak to how hard that is to set up having never done it though).

Thanks, Git submodules seems like an excellent option I was not aware of

1 Like

Thanks, I just started playing around with PkgTemplates.jl seems pretty comprehensive.