basic React Gatsby project - can't push to GitHub - getting "git push --set-upstream origin master"

755 views Asked by At

Just started a basic Gatsby project by using "gatsby new myproject". Their Git setup seems to be very different from what I'm used to. Once the project installed I created a new GitHub repo, initialized it, added remote, but when I try to push the src I'm getting :

    fatal: The current branch master has no upstream branch.
    To push the current branch and set the remote as upstream, use

         git push --set-upstream origin master

I tried setting the upstream, but it gives me an error and saying "everything is up to date":

Enumerating objects: 51, done.
Counting objects: 100% (51/51), done.
Delta compression using up to 4 threads
Compressing objects: 100% (50/50), done.
Writing objects: 100% (51/51), 408.69 KiB | 4.21 MiB/s, done.
Total 51 (delta 12), reused 0 (delta 0)
error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date

I even tried re-installing the project, but getting the same issue. Can't seem to find any info in their documentation. Not sure how Gatsby Git is setup and what needs to be done to get it working. I'm not looking to publish the project with gh-pages, just looking to track the source files development for now. Any ideas?

1

There are 1 answers

7
ksav On BEST ANSWER

While running gatsby new myproject uses git to clone gatsby-starter-default into the myproject folder (and then install the dependencies), it doesn't actually create a local git repo for you.

So the workflow you're looking for might be to create a GitHub repo called myproject, then run:

gatsby new myproject
cd myproject

git init
git add .
git commit -m "first commit"
git remote add origin [email protected]:ksav/myproject.git
git push -u origin master