# Using my local copy of a package

**URL:** <https://discourse.julialang.org/t/using-my-local-copy-of-a-package/5941>\
**Category:** New to Julia\
**Created:** [September 18, 2017, 5:31am UTC](https://discourse.julialang.org/t/using-my-local-copy-of-a-package/5941 "2017-09-18T05:31:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [September 18, 2017, 5:31am UTC](https://discourse.julialang.org/t/using-my-local-copy-of-a-package/5941/1 "2017-09-18T05:31:37Z")

</div>

I would like to add changes to some packages, I guess I really mean make a pull request.

I’m following the instructions in “Making changes to an existing package”.

```julia
Pkg.checkout("name")

```

So now I have my local copy and I can go in and edit it.

What I’m not clear on is how to make sure the next time I say

```julia
using PackageName

```

that it will actually be using my local copy of the package ?

I do realize that I could add my functionality and then a corresponding test and do

```julia
Pkg.test("PackageName")

```

But I would also like to run some code that depends on the package.

Thanks !

---

<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:** [September 18, 2017, 5:44am UTC](https://discourse.julialang.org/t/using-my-local-copy-of-a-package/5941/2 "2017-09-18T05:44:53Z")

</div>

You **always** have a local copy. `Pkg.checkout` just makes it the `master` branch (when you don’t specify a second argument).

You need to create and checkout a _branch_ (a git concept, [read up on it](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging)), which you can then submit as a PR. If, in the meantime, you want to revert to master or a released version, just commit your changes on your branch and checkout the one you need.

---

<div class="post-metadata">

**Author:** ![svaksha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/svaksha/32/881_2.png) [@svaksha](https://discourse.julialang.org/u/svaksha)\
**Post date:** [September 18, 2017, 7:34am UTC](https://discourse.julialang.org/t/using-my-local-copy-of-a-package/5941/3 "2017-09-18T07:34:34Z")

</div>

If your workplace does not allow you to contribute changes upstream as a PR, then you could push changes in your private git repo and instead of the ‘package name’ you can give your private git url to checkout.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [September 18, 2017, 3:28pm UTC](https://discourse.julialang.org/t/using-my-local-copy-of-a-package/5941/4 "2017-09-18T15:28:29Z")

</div>

@Tamas_Papp oh - i didn’t realize the package source was actually sitting in .julia. I’m sort of stuck in the object file mentality where I assumed that there was some sort of binary blob which is being loaded when you execute “using”. So now that I’ve actually looked in .julia, I see that the full packages are sitting there.

But I also see that there is a lib directory with .ji files. Don’t those files need to be re-generated when I modify the existing library ?

@svaksha it’s not a matter of not being able to submit changes. I’m simply unclear if I have to take some sort of action, e.g. a precompilation step, so that when I modify the library the changes are picked up by my existing code.

I should just modify the library, put in some changes, and see if things do what I expect.

---

<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:** [September 18, 2017, 3:38pm UTC](https://discourse.julialang.org/t/using-my-local-copy-of-a-package/5941/5 "2017-09-18T15:38:12Z")

</div>

> [@purplishrock](#):
>
> But I also see that there is a lib directory with .ji files. Don’t those files need to be re-generated when I modify the existing library ?

That should happen automatically.
