Search code examples
githubgithub-pages

GitHub Error when uploading repository to GitHub Pages


I am trying to upload a repository to github pages but when I do I get this error:

Total 40 (delta 14), reused 0 (delta 0)
error: RPC failed; curl 56 SSLRead() return error -9806
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date

Help, would be appreciated.


Solution

  • I have made an article about it. Take a look here. Or follow below:

    1. Create a new local brunch in your project and name it ‘gh-pages’.

    2. Go to github and copy the name of the repository. Let’s assume the repository name is ‘my-first-project’

    3. Create a new file in root directory of your project and name it ‘vue.config.js’.

    4. In ‘vue.config.js’ file paste the following code: // vue.config.js module.exports = { baseUrl: ‘/my-first-project/’ } NOTE: in baseUrl inside the // chars you have to put the name of your project.

    5. Find and open the file .gitignore located in root directory of your project.Next, find and comment the line which has the text ‘/dist’. NOTE: this folder it’s ignored by default that’s why we have to comment it.

    6. Run the command: git add dist && git commit -m "Initial dist subtree commit" IMPORTANT: Make sure you don’t commited the vue.config.js and .gitignore files

    7. Run the command: git subtree push --prefix dist origin gh-pages

    8. Navigate to github on your browser and open your repository. Next click ‘Settings’ just like it is displayed below.

      enter image description here

      1. Scroll and find the section GitHub Pages. Select the ‘gh-pages’ brunch and click Save. enter image description here

      2. You might have to wait a while, but if everything goes well you will see the following alert message. Generally you have to wait 8–10 minutes until this process is done.

    enter image description here

    That's it!