github deployment

26 views
Skip to first unread message

Jim Schmitz

unread,
Jul 1, 2016, 1:29:17 AM7/1/16
to nikola-...@googlegroups.com
What is the proper way to set up nikola with github? 

I serve my website out of a github repo in a gh-pages branch. I deploy to that branch using the "nikola github_deploy" command.​

The two branches in one repo are "master" and 'gh-pages". I would like to be able to commit my source files to the master branch and the generated website to the gh-pages branch.

Unfortunately every time I commit to one branch I can't commit to the other one without cloning the whole repo to a new local copy and committing from there. It keeps rejecting my commits or deploy attempts:

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.

But I never commit from any other machine than this one. I don't know why it keeps saying that.

Part of the problem might be that I started hosting on github long after starting a github repo for the source, so the gh-pages branch was added later and probably not done correctly. I also don't know git so well.

Is this something I can fix easily? Or should I start over with a clean repo? The git history isn't important to me, so which ever is easier.

If it helps, my current git history looks like:

$ git log --oneline --decorate --graph --all
* 1f3d6b5 (ssh-origin/gh-pages, gh-pages) Nikola auto commit.
* 5fd9e05 (origin/gh-pages) Nikola auto commit.
* 8bd6301 Nikola auto commit.
* 98124aa Nikola auto commit.
* a62755e Nikola auto commit.
* c7040cf Nikola auto commit.
* 0c25422 Nikola auto commit.
* 2f594f6 Nikola auto commit.
* 8747b77 Nikola auto commit.
* 9e90a42 Nikola auto commit.
| * f983430 (HEAD -> master, origin/master, origin/HEAD) https => http
| * 3092af4 new post and theme
| * 46aa861 gnossienne 4
| * 7138644 another-lamp
...

Thanks!

-Jim

Puneeth Chaganti

unread,
Jul 1, 2016, 3:11:05 AM7/1/16
to nikola-...@googlegroups.com

Hi Jim,

[..]
> Part of the problem might be that I started hosting on github long after
> starting a github repo for the source, so the gh-pages branch was added
> later and probably not done correctly. I also don't know git so well.

Force pushing on the gh-pages branch should fix this problem. Something like,

git checkout gh-pages
git push -f origin gh-pages

- Puneeth

Jim Schmitz

unread,
Jul 1, 2016, 9:16:28 PM7/1/16
to nikola-...@googlegroups.com
The problem was I had two git remotes (origin and ssh-origin) pointing to the same repository on github. I got rid of the first one and now everything works perfectly.

Thanks!



- Puneeth

--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages