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

**URL:** <https://discourse.julialang.org/t/tracking-a-project-environment-including-a-dev-sub-directory-on-git/45395>\
**Category:** New to Julia\
**Tags:** question, pkg, git\
**Created:** [August 22, 2020, 11:57pm UTC](https://discourse.julialang.org/t/tracking-a-project-environment-including-a-dev-sub-directory-on-git/45395 "2020-08-22T23:57:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkarikom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkarikom/32/7096_2.png) [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Post date:** [August 22, 2020, 11:57pm UTC](https://discourse.julialang.org/t/tracking-a-project-environment-including-a-dev-sub-directory-on-git/45395/1 "2020-08-22T23:57:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 23, 2020, 5:54am UTC](https://discourse.julialang.org/t/tracking-a-project-environment-including-a-dev-sub-directory-on-git/45395/2 "2020-08-23T05:54:35Z")

</div>

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

> **[GitHub - JuliaCI/PkgTemplates.jl: Create new Julia packages, the easy way](https://github.com/JuliaCI/PkgTemplates.jl)**
>
> Create new Julia packages, the easy way. Contribute to JuliaCI/PkgTemplates.jl development by creating an account on GitHub.

> **[GitHub - tpapp/PkgSkeleton.jl: Generate Julia package skeletons using a...](https://github.com/tpapp/PkgSkeleton.jl)**
>
> Generate Julia package skeletons using a simple template system - GitHub - tpapp/PkgSkeleton.jl: Generate Julia package skeletons using a simple template system

---

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [August 23, 2020, 11:23am UTC](https://discourse.julialang.org/t/tracking-a-project-environment-including-a-dev-sub-directory-on-git/45395/3 "2020-08-23T11:23:43Z")

</div>

If I understand the question correctly, one solution is to keep the `./dev` packages as [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-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,

```julia
$ 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).

---

<div class="post-metadata">

**Author:** ![mkarikom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkarikom/32/7096_2.png) [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Post date:** [August 23, 2020, 2:36pm UTC](https://discourse.julialang.org/t/tracking-a-project-environment-including-a-dev-sub-directory-on-git/45395/4 "2020-08-23T14:36:24Z")

</div>

> [@marius311](#):
>
> If I understand the question correctly, one solution is to keep the `./dev` packages as [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules)

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

---

<div class="post-metadata">

**Author:** ![mkarikom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkarikom/32/7096_2.png) [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Post date:** [August 23, 2020, 2:56pm UTC](https://discourse.julialang.org/t/tracking-a-project-environment-including-a-dev-sub-directory-on-git/45395/5 "2020-08-23T14:56:00Z")

</div>

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