# Clone and checkout my fork, on travis-CI?

**URL:** <https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637>\
**Category:** General Usage\
**Tags:** travis\
**Created:** [August 17, 2018, 7:43pm UTC](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637 "2018-08-17T19:43:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![improbable22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/improbable22/32/5464_2.png) [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Post date:** [August 17, 2018, 7:43pm UTC](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637/1 "2018-08-17T19:43:32Z")

</div>

I updated a registered package I need to work with v0.7, and made a pull request. On my fork this is branch `julia07fixes`.

Can I get Travis-CI to download this version when testing another package of mine? (Which is 0.7 only.)

I tried, very naively, editing `.travis.yml` like this:

```julia
## uncomment the following lines to override the default test script
script:
  - julia -e 'Pkg.clone("https:// github .. me ... ThePackage.jl"); Pkg.checkout("ThePackage", "julia07fixes")' 
  - julia -e 'Pkg.clone(pwd()); Pkg.build("MyPackage7"); Pkg.test("MyPackage7"; coverage=true)'

```

but this fails. And I now see that `Pkg.checkout` doesn’t seem to exist on 0.7 at all. What should I try?

---

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [August 18, 2018, 1:38pm UTC](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637/2 "2018-08-18T13:38:02Z")

</div>

Can you just put your fork to the Require file?

---

<div class="post-metadata">

**Author:** ![improbable22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/improbable22/32/5464_2.png) [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Post date:** [August 18, 2018, 2:57pm UTC](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637/3 "2018-08-18T14:57:43Z")

</div>

But how exactly? Clearly if I just put the package name in REQUIRE then I get the registered version. I’d like to put something like `https://github/.../ThePackage.jl#julia07fixes` that doesn’t work. Explicitly calling Pkg from inside `runtests.jl` also doesn’t work, because `Pkg.checkout` seems not to exist.

---

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [August 18, 2018, 3:22pm UTC](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637/4 "2018-08-18T15:22:31Z")

</div>

Sorry I was wrong you cannot do it. Here is a workaround: [How to add unregistered packages to REQUIRE?](https://discourse.julialang.org/t/how-to-add-unregistered-packages-to-require/4737)

---

<div class="post-metadata">

**Author:** ![improbable22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/improbable22/32/5464_2.png) [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Post date:** [August 18, 2018, 4:21pm UTC](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637/5 "2018-08-18T16:21:48Z")

</div>

Ah I hadn’t thought of that. But how do I call `pkg> add https://github/.../ThePackage.jl#julia07fixes` without the `]`-mode?

---

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [August 18, 2018, 6:32pm UTC](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637/6 "2018-08-18T18:32:04Z")

</div>

> [@Getting latest version of Pkg?](https://discourse.julialang.org/t/getting-latest-version-of-pkg/13138/5):
>
> In addition to the REPL mode (pkg\> add XLSX#master) you can use Pkg.add(PackageSpec(name = "XLSX", rev = "master")).

---

<div class="post-metadata">

**Author:** ![improbable22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/improbable22/32/5464_2.png) [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Post date:** [August 18, 2018, 9:51pm UTC](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637/7 "2018-08-18T21:51:51Z")

</div>

OK many thanks, that sounds like the right thing. I made `deps/build.jl` look like this:

```julia
Pkg.rm("ThePackage") ## because it's also in REQUIRE
@info "removed old ThePackage"
Pkg.add(Pkg.PackageSpec(name="ThePackage", url="https://github.com/.../ThePackage.jl", rev="julia07fixes"))
@info "added new ThePackage"

```

This appears to run (although I only see first `@info` when I have a typo in `Pkg.add` – otherwise it’s silent.) But the remainder of the test still seems to see the old package not the new one – I get its warnings, and tests that need it fail.
