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.
This is not in Eclipse, but this is how I do the move in command line without a second clone of the repo. First I configure my javadoc plugin to generate the docs in the folder "apidocs" in my project directory using this in my pom.xml
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<reportOutputDirectory>apidocs</reportOutputDirectory>
</configuration>
</plugin>
...
Then I add "apidocs" to my .gitignore in master. Then to make and move the javadocs, I do the following - starting in master:
mvn javadoc:javadoc
tar cfv apidocs.tar apidocs
git checkout gh-branches
tar xfv apidocs.tar
git commit -a
git push
rm apidocs.tar
git checkout master
The trick is that the tar file (which never ends up in the repo) does survive the switch between branches - whereas it seems as though the changes to apidocs files in the folder hierarchy vanish when I switch branches.
Nicely when I switch back to master - the apidocs folder is gone.
I suggest that you use a second clone of your repository with a checked out gh-pages
branch. Then you can easily move and commit your generated files without switching between the master and the gh-pages branch.
I found not so good solution as I want, but it is works:
How to update:
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!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.