Home > OS >  How can I upload my react.js files to GitHub? [closed]
How can I upload my react.js files to GitHub? [closed]

Time:09-17

I have been having issues uploading my react project to GitHub through the command line. It's throwing up an error about a change in authentication which started August 13. I have tried all possible solutions recommended to me such as generating a token and so on but it fails.

Can I upload the files directly to GitHub and use them on Heroku?

enter image description here

CodePudding user response:

You need to set up ssh. here is the link to how to handle it :

https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh

If you already did this, then your issue is you have change the remote of .git to ssh. Currently it is still using https

git remote add  sshLinkOfYourRepo

CodePudding user response:

You first have to properly upload your Project on Github. Then and only then you can connect heroku to Github.

1- Make sure you have created a repository for your project.

2- Now from your terminal or IDE enter these commands :

git init 

This will add files in your new local repository. Your files will now be staged for their first commit.

git add .

This will add all the files inside that folder.

git status 

You can used this command to check if all the files are staged for commit.

git commit -m "first commit for example"

Commit the files that you have staged in your repository.

git remote add origin "your github repository URL"

Then you can push your code to your repository using:

git push -u origin main

Afterwards, you can go to heroku create a project from there and simply head to Deploy, then from Deployment method click on connect to GitHub.

Here's a link that explains it as well: https://blog.heroku.com/heroku_github_integration

  • Related