This page is no longer maintained — Please continue to the home page at www.scala-lang.org

[OT] Trying to pub up scaladocs on github

5 replies
Kenneth McDonald
Joined: 2009-01-11,
User offline. Last seen 42 years 45 weeks ago.
Following somebody's (Josh's, I think) advice on working towards putting my scaldocs up on my github site, I followed the following github instructions:

In order to create a new root branch, first ensure that your working directory is clean by committing or stashing any changes. The following operation will lose any uncommitted changes!

$ cd /path/to/fancypants
$ git symbolic-ref HEAD refs/heads/gh-pages
$ rm .git/index
$ git clean -fdx

After running this you’ll have an empty working directory (don’t worry, your main repo is still on the master branch). Now you can create some content in this branch and push it to GitHub. For example:

$ echo "My GitHub Page" > index.html
$ git add .
$ git commit -a -m "First pages commit"
$ git push origin gh-pages
I did do a "commit -a" followed by a "push" before doing any of this, so I'm confident that, if nowhere else, my code still all exists on github. My idea browser is showing a (mostly) empty project, which I expected. However, I expected there to be an obvious way to switch between my "old" branch, with all of my code, and my "new" branch, where the docs will be generated and pushed from.
However, I'm finding "git help command" to be less than useful; most often, it says "There is no help for git-command".
I'm going to do some reading right now to try to resolve this, but if anyone wanted to give me the simple command for switching back and forth between branches, that would alleviate a certain amount of anxiety.
By the way, does anyone have a maven task for pushing a scaladoc directory onto github? I have a fair number of docs on my package, and continue to add to them, and would really like people to be able to read about the package and API without going through the hassle of downloading and getting everything working first.
Thanks,Ken
David Flemström
Joined: 2009-08-10,
User offline. Last seen 42 years 45 weeks ago.
Re: [OT] Trying to pub up scaladocs on github
Use "git checkout master" to work on your code's master branch, and "git checkout gh-pages" to work on the GitHub Pages for your project.
On Tue, Oct 12, 2010 at 9:15 PM, Kenneth McDonald <kenneth [dot] m [dot] mcdonald [at] sbcglobal [dot] net> wrote:
Following somebody's (Josh's, I think) advice on working towards putting my scaldocs up on my github site, I followed the following github instructions:

In order to create a new root branch, first ensure that your working directory is clean by committing or stashing any changes. The following operation will lose any uncommitted changes!

$ cd /path/to/fancypants
$ git symbolic-ref HEAD refs/heads/gh-pages
$ rm .git/index
$ git clean -fdx

After running this you’ll have an empty working directory (don’t worry, your main repo is still on the master branch). Now you can create some content in this branch and push it to GitHub. For example:

$ echo "My GitHub Page" > index.html
$ git add .
$ git commit -a -m "First pages commit"
$ git push origin gh-pages
I did do a "commit -a" followed by a "push" before doing any of this, so I'm confident that, if nowhere else, my code still all exists on github. My idea browser is showing a (mostly) empty project, which I expected. However, I expected there to be an obvious way to switch between my "old" branch, with all of my code, and my "new" branch, where the docs will be generated and pushed from.
However, I'm finding "git help command" to be less than useful; most often, it says "There is no help for git-command".
I'm going to do some reading right now to try to resolve this, but if anyone wanted to give me the simple command for switching back and forth between branches, that would alleviate a certain amount of anxiety.
By the way, does anyone have a maven task for pushing a scaladoc directory onto github? I have a fair number of docs on my package, and continue to add to them, and would really like people to be able to read about the package and API without going through the hassle of downloading and getting everything working first.
Thanks, Ken

david.bernard
Joined: 2009-01-08,
User offline. Last seen 1 year 27 weeks ago.
Re: [OT] Trying to pub up scaladocs on github
My suggestion (may be what I plan to do for a sample project later this week => not tested ) :* use 2 local directories : * one for the code * one for the doc to deploy => run only on gh-pages branch * set distribution site into your pom.xml to the doc directory (eg : file://${project.basedir}/../${project.artifactId}-gh-pages )* run "mvn site"* cd ../xxx-gh-pages* git commit * git push origin gh-pages
or somethings like that.
(The last git operation should be scriptable into pom.xml but I don't investigate yet)
/davidB

On Tue, Oct 12, 2010 at 21:15, Kenneth McDonald <kenneth [dot] m [dot] mcdonald [at] sbcglobal [dot] net> wrote:
Following somebody's (Josh's, I think) advice on working towards putting my scaldocs up on my github site, I followed the following github instructions:

In order to create a new root branch, first ensure that your working directory is clean by committing or stashing any changes. The following operation will lose any uncommitted changes!

$ cd /path/to/fancypants
$ git symbolic-ref HEAD refs/heads/gh-pages
$ rm .git/index
$ git clean -fdx

After running this you’ll have an empty working directory (don’t worry, your main repo is still on the master branch). Now you can create some content in this branch and push it to GitHub. For example:

$ echo "My GitHub Page" > index.html
$ git add .
$ git commit -a -m "First pages commit"
$ git push origin gh-pages
I did do a "commit -a" followed by a "push" before doing any of this, so I'm confident that, if nowhere else, my code still all exists on github. My idea browser is showing a (mostly) empty project, which I expected. However, I expected there to be an obvious way to switch between my "old" branch, with all of my code, and my "new" branch, where the docs will be generated and pushed from.
However, I'm finding "git help command" to be less than useful; most often, it says "There is no help for git-command".
I'm going to do some reading right now to try to resolve this, but if anyone wanted to give me the simple command for switching back and forth between branches, that would alleviate a certain amount of anxiety.
By the way, does anyone have a maven task for pushing a scaladoc directory onto github? I have a fair number of docs on my package, and continue to add to them, and would really like people to be able to read about the package and API without going through the hassle of downloading and getting everything working first.
Thanks, Ken

david.bernard
Joined: 2009-01-08,
User offline. Last seen 1 year 27 weeks ago.
Re: [OT] Trying to pub up scaladocs on github
something like that (to push to github) :<build>    <plugins>      <plugin>        <artifactId>maven-antrun-plugin</artifactId>        <version>1.6</version>         <executions>          <execution>            <phase>deploy</phase>            <id>deploy-gh-pages</id>            <goals>               <goal>run</goal>            </goals>            <configuration>              <target>              <property name="gh-pages-dir" location=""/>               <exec executable="git" dir="${gh-pages-dir}">                <arg line="add ."/>              </exec>              <exec executable="git" dir="${gh-pages-dir}">                 <arg line="commit"/>              </exec>              <exec executable="git" dir="${gh-pages-dir}">                <arg line="push origin gh-pages"/>               </exec>              </target>            </configuration>          </execution>        </executions>      </plugin>

/davidB

On Tue, Oct 12, 2010 at 21:24, David Flemström <david [dot] flemstrom [at] gmail [dot] com> wrote:
Use "git checkout master" to work on your code's master branch, and "git checkout gh-pages" to work on the GitHub Pages for your project.
On Tue, Oct 12, 2010 at 9:15 PM, Kenneth McDonald <kenneth [dot] m [dot] mcdonald [at] sbcglobal [dot] net> wrote:
Following somebody's (Josh's, I think) advice on working towards putting my scaldocs up on my github site, I followed the following github instructions:

In order to create a new root branch, first ensure that your working directory is clean by committing or stashing any changes. The following operation will lose any uncommitted changes!

$ cd /path/to/fancypants
$ git symbolic-ref HEAD refs/heads/gh-pages
$ rm .git/index
$ git clean -fdx

After running this you’ll have an empty working directory (don’t worry, your main repo is still on the master branch). Now you can create some content in this branch and push it to GitHub. For example:

$ echo "My GitHub Page" > index.html
$ git add .
$ git commit -a -m "First pages commit"
$ git push origin gh-pages
I did do a "commit -a" followed by a "push" before doing any of this, so I'm confident that, if nowhere else, my code still all exists on github. My idea browser is showing a (mostly) empty project, which I expected. However, I expected there to be an obvious way to switch between my "old" branch, with all of my code, and my "new" branch, where the docs will be generated and pushed from.
However, I'm finding "git help command" to be less than useful; most often, it says "There is no help for git-command".
I'm going to do some reading right now to try to resolve this, but if anyone wanted to give me the simple command for switching back and forth between branches, that would alleviate a certain amount of anxiety.
By the way, does anyone have a maven task for pushing a scaladoc directory onto github? I have a fair number of docs on my package, and continue to add to them, and would really like people to be able to read about the package and API without going through the hassle of downloading and getting everything working first.
Thanks, Ken


Kenneth McDonald
Joined: 2009-01-11,
User offline. Last seen 42 years 45 weeks ago.
Re: [OT] Trying to pub up scaladocs on github

On Oct 12, 2010, at 2:24 PM, David Flemström wrote:

> Use "git checkout master" to work on your code's master branch, and "git checkout gh-pages" to work on the GitHub Pages for your project.
>
OK, I got to this stage. However, the maven specialized scala targets no longer show up--for example, I no longer have a scaladoc target. Did I forget to commit a file to the original master branch? Will investigate...and if I messed up, what's the most graceful way of recovering?

Thanks,
Ken

Kenneth McDonald
Joined: 2009-01-11,
User offline. Last seen 42 years 45 weeks ago.
Re: [OT] Trying to pub up scaladocs on github

Never mind--doing an "import new Maven project" (or something to that effect) in IDEA cured the problem. I understand a lot more about maven than I used to, but large parts are still black magic :-)

Ken

On Oct 12, 2010, at 3:11 PM, Kenneth McDonald wrote:

>
> On Oct 12, 2010, at 2:24 PM, David Flemström wrote:
>
>> Use "git checkout master" to work on your code's master branch, and "git checkout gh-pages" to work on the GitHub Pages for your project.
>>
> OK, I got to this stage. However, the maven specialized scala targets no longer show up--for example, I no longer have a scaladoc target. Did I forget to commit a file to the original master branch? Will investigate...and if I messed up, what's the most graceful way of recovering?
>
> Thanks,
> Ken
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland