How to add a React app to a GitHub repository

Carlos Martinez
2 min readMay 19, 2022

--

If you’re starting out with React and you want to click and drag your project to add it to a repository, you’ll realize that there’s a limit on the amount of files you can upload. As you know React apps have thousands of files so you can see this can get frustrating, don’t worry I will explain how to add this using Git on your terminal.

1.) Initialize Local Directory

In your projects folder enter the following command

git init

2.) Add all the files in the local directory

git add .

3.) Commit the files to the repository and add a message

git commit -m "first commit"

4.) Create a new repository

5.) Enter a name and click “Create Repository”

6.) Copy the URL to the Clipboard

7.) Go back to your Terminal and set the origin by pasting the URL from the clipboard.

git remote add origin http://Paste URL here

8.) Push your files from Local repository to GitHub

git push -u origin master 

And that’s it! You added your React project to your GitHub repository. If you need to push your code after modifications use this

git commit -m “message here”
git push -u origin master

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response