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.22k stars 190 forks source link

Failed to get remote.origin.url, everything set up #528

Open its-mrarsikk opened 10 months ago

its-mrarsikk commented 10 months ago

I created a TypeScript React app with create-react-app and tried deploying it with gh-pages. I have set up an origin. The remote repo exists. I have been following this tutorial. Here's more detail:

git remote -v

origin  https://github.com/its-mrarsikk/tic-tac-toes.git (fetch)
origin  https://github.com/its-mrarsikk/tic-tac-toes.git (push)

package.json scripts

"scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

I have also tried to force it with -r:

"scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build -r https://github.com/its-mrarsikk/tic-tac-toes.git",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

Detailed output

$ npm run deploy

> tictactoes@0.1.0 predeploy
> npm run build

> tictactoes@0.1.0 build
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  46.57 kB  build/static/js/main.0cb0ace7.js
  1.78 kB   build/static/js/787.dafb6d84.chunk.js
  515 B     build/static/css/main.f855e6bc.css

The project was built assuming it is hosted at /tic-tac-toes/.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  https://cra.link/deployment

> tictactoes@0.1.0 deploy
> gh-pages -d build -r https://github.com/its-mrarsikk/tic-tac-toes.git

Error: Failed to get remote.origin.url (task must either be run in a git repository with a configured origin remote or must be configured with the "repo" option).
    at /run/media/marcel/Хранилище/Dev/Web/tictactoes/node_modules/gh-pages/lib/git.js:214:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

What to do now?

WolfJack24 commented 4 days ago

I am having the same issue, and it is quite annoying. I hope this can be fixed