Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using create-react-app and connecting it to my git repository?

Apologize up front as I am super new to React. I run the command npx create-react-app {test-app} and I understand that it creates a git repository for me. My confusion is I don't understand how I connect my github page to that repository. (if that makes sense) connect my newly created GitHub repo page connected to React project Hope this makes sense.

like image 704
Greg Meff Avatar asked Jan 30 '26 06:01

Greg Meff


2 Answers

You can create a Github repository. Then copy the link to clone the repository. Next you can head towards the react project folder and open the terminal.

Run git remote add origin <url_you_copied>. After that you can do, add commit push operations.

like image 96
Rohith V Avatar answered Jan 31 '26 19:01

Rohith V


Run the below commands:

git init
git remote add origin <url you copied>

git init initializes a local git repo. git remote add origin <url you copied> is just what repo to push the code to.

Then, to push a commit:

git add .
git commit -m "commit message"
git push origin main
like image 29
KetZoomer Avatar answered Jan 31 '26 18:01

KetZoomer