# Deploy pages from branches

**URL:** <https://discourse.julialang.org/t/deploy-pages-from-branches/94274>\
**Category:** General Usage\
**Tags:** question, documenter\
**Created:** [February 8, 2023, 1:20pm UTC](https://discourse.julialang.org/t/deploy-pages-from-branches/94274 "2023-02-08T13:20:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rex\_Wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rex_wang/32/35108_2.png) [@Rex\_Wang](https://discourse.julialang.org/u/Rex_Wang)\
**Post date:** [February 8, 2023, 1:20pm UTC](https://discourse.julialang.org/t/deploy-pages-from-branches/94274/1 "2023-02-08T13:20:30Z")

</div>

When translating the docs of a repo, it is natural to write codes in different branch. [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl) provides two ways to deploy docs from different sources: [Hosting Documentation · Documenter.jl](https://documenter.juliadocs.org/stable/man/hosting/#Documentation-Versions)

1. Deploy by version number

2. Deploy from `devbranch`

Below is my code for docs of [binarybuilder](https://rexwzh.github.io/BinaryBuilder.jl/dev/).

```julia
# make.jl
deploydocs(
    repo = "github.com/RexWzh/BinaryBuilder.jl.git",
    devurl = "dev",
    devbranch = "zh_CN",
    versions = ["dev" => "dev", "stable" => "v^"], # use git tag to track other language(dumb way)
    # forcepush = true,
)

```

My question is

> **Q: Can I specify more branches?**

Then I can

- use `en` to track the original branch
- use `zh` to track the translated version
- use `mix` to store the mixed-language docs

Also,

> Q2: **Is there someway to overwrite the `gh-pages` branch rather than merge?**

I’ve tried the keyword `forcepush` but [old folders](https://github.com/RexWzh/BinaryBuilder.jl/tree/gh-pages) are not removed.

Thanks for your time!

---

<div class="post-metadata">

**Author:** ![mortenpi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mortenpi/32/158_2.png) [@mortenpi](https://discourse.julialang.org/u/mortenpi)\
**Post date:** [February 19, 2023, 11:16pm UTC](https://discourse.julialang.org/t/deploy-pages-from-branches/94274/2 "2023-02-19T23:16:08Z")

</div>

> **Q: Can I specify more branches?**

I think your best option here is to set `devbranch` and `devurl` dynamically, by checking the relevant CI variables yourself in `make.jl`. Documenter itself doesn’t have any support for multiple dev branches.

Although if you are going for translations, maybe you can dynamically set `dirname`? That way you could deploy something like `/en/dev/`, `/en/v0.1.0`, `/zh_CN/dev/`, `/zh_CN/v0.1.0`?

> Q2: **Is there someway to overwrite the `gh-pages` branch rather than merge?**

So, the short answer is no. Reason, of course, being that that would remove your versioned docs, which you generally don’t want to happen.
