Search code examples
javagithubjavadoc

How I can move JavaDoc from master branch to gh-pages branch on GitHub using EGit and Eclipse?


I have a java project hosted on a GitHub. And I want to allow see JavaDoc HTML-page for this hosting. For this purpose I create gh-pahes branch.

How I can easy move/commit JavaDoc (that created into master branch) into gh-pages branch using EGit and Eclipse IDE? I regenerate JavaDoc often and want find way to easy commit new version JavaDoc to gh-pages but working into master branch.


Solution

  • I found not so good solution as I want, but it is works:

    1. Create gh-pages branch in a GitHub.
    2. Checkout this branch.
    3. Switch from gh-pages to master and generate javadoc.
    4. Commit javadocs.
    5. Switch from master to gh-pages branch.
    6. You can see that gh-pages branch includes javadoc folder.
    7. Just commit this folder into gh-pages.
    8. See how to update!

    How to update:

    1. In master branch remove all javadoc directory and regenerate javadoc.
    2. Commit only the generated javadoc!.
    3. Switch from master to gh-pages branch.
    4. Remove old javadoc and commit this changes!
    5. Right-click on you project and select Team -> Show in History.
    6. Found you commit with javadoc from master branch.
    7. Right-click on this commit and select Cherry Pick.

    Thats is all! Now you commit from master branch copy to gh-pages branch!

    I don't know WHY I need using special branch for access to my HTML docs in the GitHub?! Use Google Code is MORE useful!