This seems like a simple thing, but cannot find the solution online. First, I know I can probably do this on the Terminal, but I would prefer to do this with Tower. Not all of my colleagues will use the Terminal. I have a repository (https://github.com/jbryer/psabook/) and I would like to use Github pages with it. I want the master branch to track the source (mostly markdown files). I build a website from those files and would like to publish that to the gh-pages branch. Can I have that as a subdirectory of my repository be tracked only for that branch?
Here's what I have tried from this post: http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html
I create a repository called psabook from Github.com. Then do the following from the command line (on a Mac if it matters):
mkdir foobar
cd foobar
git init
touch README
git add README
git commit -m "initial commit"
git remote add origin git@github.com:jbryer/psabook.git
git push origin master
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "Hello PSA Book" > index.html
git add .
git commit -a -m "first gh-page"
git push origin gh-pages
git checkout master
git submodule add -b gh-pages git@github.com:jbryer/psabook.git _site
The output was:
Cloning into '_site'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 0), reused 6 (delta 0)
Receiving objects: 100% (6/6), done.
Checking connectivity... done.
Continuing...
git status
Returned:
On branc master
Changes to be committed:
(use "git reset HEADE <file>..." to unstage)
new file: .gitmodules
new file: _site
Continuing...
git commit -m "added gh-pages as submodule"
git push
It is this command that I get an error (note that I had to escape the parens too):
git submodule init
Submodule '_site' (git@github.com:jbryer/psagook.git) registered for path '_site'
This is the error I get:
error: pathspec 'Submodule' did not match any file(s) known to git.
error: pathspec '(git@github.com:jbryer/psabook.git)' did not match any file(s) known to git.
error: pathspec 'registered' did not match any file(s) known to git.
error: pathspec 'for' did not match any file(s) known to git.
error: pathspec 'path' did not match any file(s) known to git.
Did you forget to 'git add'?