When trying to use gh-pages to deploy a react app I get the following error
...
$ gh-pages -d build
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).
...
The remote is set as origin
$ git remote -v
origin https://github.com/{user_name}/{repo_name} (fetch)
origin https://github.com/{user_name}/{repo_name} (push)
The solution for me was that I had a remote origin set, however it would throw me this error when my project folder was located on an external hard drive. Made a new react project on my local hard drive and now it works despite everything else being the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With