tschaub / gh-pages

General purpose task for publishing files to a gh-pages branch on GitHub
https://www.npmjs.com/package/gh-pages
MIT License
3.24k stars 190 forks source link

Github Pages Error Message #189

Open ghost opened 7 years ago

ghost commented 7 years ago

I have a githab repository and project Page as github pages. In the project directory that I use the github repository created has git push, git pull, git build and git deploy without problems. The site can be found at http://ux.kwpse.com call. Unfortunately, it is not possible to make the page using https://ux.kwpse.com call. In the settings, it is explicitly pointed out, That it is not possible to call custom subdomains with https.

I have on another computer the repository via git clone downloaded. Git pull, git push, git build works perfectly.

I onlye hae git version 1.8.3.1. This can be the reason for this error. But it is not possible to update git.

I suspect that the cause is the subdomain. How do I solve the problem? With git deploy I get the following error message:

deploy /home/jklein/Projekte/test
> gh-pages -d styleguide

GH-PAGES 3991: Cloning https://github.com/kwpse/styleguide.git into node_modules/gh-pages/.cache/aHR0cHM6Ly9naXRodWIuY29tL2t3cHNlL3N0eWxlZ3VpZGUuZ2l0
GH-PAGES 3991: Cleaning
GH-PAGES 3991: Fetching origin
GH-PAGES 3991: Checking out origin/gh-pages 
fatal: attempt to fetch/clone from a shallow repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Here the message from the first Repo

kwpse-styleguide@0.0.1 deploy /home/jklein/Projekte/kwpse-styleguide
> gh-pages -d styleguide

GH-PAGES 4042: Cloning https://github.com/kwpse/styleguide.git into node_modules/gh-pages/.cache/aHR0cHM6Ly9naXRodWIuY29tL2t3cHNlL3N0eWxlZ3VpZGUuZ2l0
GH-PAGES 4042: Cleaning
GH-PAGES 4042: Fetching origin
GH-PAGES 4042: Checking out origin/gh-pages 
GH-PAGES 4042: Removing files
GH-PAGES 4042: Copying files
GH-PAGES 4042: Adding all
GH-PAGES 4042: Committing
GH-PAGES 4042: Pushing

I got an answer from the git team.

If it only happens in your script, make sure that the script runs from a user that has access to your GitHub credentials.

stunstunstun commented 6 years ago

I have same issue!

mikailcetinkaya commented 6 years ago

you should enable github page feature on github project settings

acierto commented 4 years ago

I experienced the same issue. The most confusing thing, that on Mac it works perfectly, but on Linux, where we run CI/CD it failed.

The problem that by default gh-pages clones the repo with --depth=1. That makes the repository shallow and it's impossible to push changes from there. If you will check your folder node_modules/gh-pages/cache/git@ you'll find there file named shallow. So that file was created on Linux, but not on Mac.

The simplest way which I found to fix that issue is to specify --depth=0. Example how i do it in my gulp configuration: gulp.task('gh-publish', (cb) => ghPages.publish(${paths.ghPagesDir}, {depth: 0, dotfiles: true}, cb));