Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github_deploy broken if no remote gh-pages branch #1464

Closed
talos opened this issue Oct 30, 2014 · 5 comments
Closed

github_deploy broken if no remote gh-pages branch #1464

talos opened this issue Oct 30, 2014 · 5 comments

Comments

@talos
Copy link

talos commented Oct 30, 2014

If you just started out with Nikola and your remote doesn't have a gh-pages branch yet (which will be the case for most people), then github_deploy crashes with:

ERROR: github_deploy: Failed GitHub deployment — command ['git', 'pull', 'origin', 'gh-pages:gh-pages'] returned 1

Since git pull origin gh-pages:gh-pages won't work if there's no remote gh-pages branch. This is a big problem, because creating and pushing the blank branch is possible but nontrivial, and is one of the main automation "bonuses" of having a nikola github_deploy in the first place.

@talos
Copy link
Author

talos commented Oct 30, 2014

A workaround, for the time being, is to do the following (with a clean repo, of course!) with a new project before using github_deploy:

git checkout --orphan gh-pages
git rm -rf .
git commit --allow-empty -m 'first commit'
git push origin gh-pages:gh-pages
git checkout master

@Kwpolska
Copy link
Member

We'll just nuke that git pull or at least make it optional.

Chris “Kwpolska” Warrick http://chriswarrick.com/
Sent from my Galaxy S3.
On Oct 30, 2014 9:22 PM, "john krauss" notifications@github.com wrote:

A workaround, for the time being, is to do the following (with a clean
repo, of course!) with a new project before using github_deploy:

git checkout --orphan gh-pages
git rm -rf .
git commit --allow-empty -m 'first commit'
git push origin gh-pages:gh-pages
git checkout master


Reply to this email directly or view it on GitHub
#1464 (comment).

@talos
Copy link
Author

talos commented Oct 31, 2014

Another possibility would be to git pull ... || echo "Could not pull" or somesuch, to ignore a non-zero exit from the pull (essentially using it when possible, but ignoring it otherwise.)

@Kwpolska Kwpolska added this to the v7.2.0 milestone Oct 31, 2014
@Kwpolska Kwpolska self-assigned this Oct 31, 2014
Kwpolska added a commit that referenced this issue Oct 31, 2014
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@Kwpolska
Copy link
Member

That we can’t do. A setting will work, though.

See #1468.

Kwpolska added a commit that referenced this issue Nov 1, 2014
fix #1464 -- don’t pull in github_deploy by default
@jean
Copy link
Contributor

jean commented Dec 24, 2015

I encountered the missing remote branch issue too, and wrote a Hello World which details the steps I followed to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants