1. Follow this instruction link in their documentation on how to add an existing project to github. Or even simpler, VSCode has a built in "Publish to Github" command, use it. Make sure you don't ignore anything you don't want in the .gitignore file. You don't need to upload the static build folder though, ignore it in the .gitignore file. Your friend can build the project himself.

  2. Open the Github repository settings and look for something called "Manage access". There you can see an option where you can invite a collaborator. That way your friend will have write access to the repo and can push change to the code.

  3. Told him to clone the repo and accept the invite -> done.

Answer from Sophon Aniketos on Stack Overflow
🌐
DEV Community
dev.to › alyarovf › upload-react-project-on-github-repository-from-vs-code-5gdp
Upload React project on github repository from VS Code - DEV Community
April 24, 2022 - Open your project folder on VS Code. Install gh-pages, this module requires Git >=1.9. npm i... Tagged with github, react, upload, project.
🌐
YouTube
youtube.com › prasad kadu
[Latest] How to push React Project to GitHub with VSCode | Clone, Commit & Push - YouTube
1. Create Repo in github2. Clone Repo on local folder3. Open repo in vscode4. Create sample react app5. Commit & Push changes to repo with VSCode ( connect v...
Published: September 30, 2022
Views: 76K
🌐
YouTube
youtube.com › watch
how to upload project on GitHub repository from VSCODE? React Project - YouTube
how to upload project on GitHub repository from VSCODE. We will explain you how to use .getignore file to ignore some files and folder in you project while u...
Published: April 22, 2024
🌐
Medium
medium.com › @regondaakhil › pushing-your-first-react-app-to-github-a-step-by-step-guide-f7b592e67658
Pushing Your First React App to GitHub: A Step-by-Step Guide | by Akhil Regonda | Medium
September 26, 2024 - The remote repository link on GitHub ... on GitHub. ... Use the “git add” command to stage all the files in your React project, and then use the “git commit” command to commit those changes....
🌐
GitHub
github.com › react › create-react-app › issues › 13278
How to deploy a React website to GitHub from Visual Studio and go live. · Issue #13278 · react/create-react-app
July 10, 2023 - Create a new Terminal with close the previous terminal and following the step: $ cd {your-app-name} /open code path for push github/ $ npm install gh-pages --save-dev {Adding the GitHub Pages dependency package} /for ready to push code/ package.json /change it in package.json and save it/ "homepage": "http://{github-username}.github.io/{repo-name}" Example: "homepage": "http://tamim-jr.github.io/react-movie-app" "predeploy" : "npm run build", "deploy" : "gh-pages -d build", ... $ git remote add origin https://github.com/{username}/{repo-name}.git /for make "build" file and push it to github/ Example: git remote add origin https://github.com/tamim-jr/react-movie-app.git
Author: react
🌐
Medium
medium.com › @brianhulela › connecting-a-react-app-to-a-github-repository-c2b563f1885d
Connecting a React App to a GitHub Repository | by Brian Hulela | Medium
May 13, 2024 - This connection is vital for tracking changes and collaborating effectively with others on your project. Here’s a step-by-step guide to help you get started: Begin by creating a React application using the following command in your Visual Studio Code terminal:
🌐
Selftaughttxg
selftaughttxg.com › 2023 › 03-23 › create-a-react-project-push-it-to-github-and-deploy-with-netlify-from-the-command-line
Create a React Project, Push It to GitHub, and Deploy With Netlify, From the Command Line |
March 20, 2023 - The GitHub CLI is an excellent method for getting your React projects up and running quickly and easily! ... This command line checklist will reveal what you need to install; If the item is installed, a corresponding version number displays. ... TIP: To copy code in the bash terminal, first select the code with the mouse by holding down left-click.
🌐
Medium
medium.com › @anna.tech › how-to-deploy-your-react-app-to-github-pages-ddab42743367
How to deploy your React App to Github Pages | by Anna Jimenez | Medium
July 23, 2020 - It is very easy to set up.You just need to push your code from your Github repository and add a few setting. It provides you github.io domain or you can set up your own custom domain.It is up to you!
Find elsewhere
🌐
YouTube
youtube.com › watch
How to Upload Project to GitHub Using Visual Studio Code (2026) | Push to GitHub From VSCode - YouTube
Welcome to this quick and easy tutorial where I’ll walk you through *how to upload your project to GitHub using Visual Studio Code*. Whether you're a complet...
Published: September 30, 2024
🌐
GitHub
github.com › gitname › react-gh-pages
GitHub - gitname/react-gh-pages: Deploying a React App (created using create-react-app) to GitHub Pages · GitHub
At this point, the gh-pages npm package is installed on your computer and the React app's dependence upon it is documented in the React app's package.json file. Open the package.json file in a text editor. $ vi package.json · In this tutorial, the text editor I'll be using is vi. You can use any text editor you want; for example, Visual Studio Code. Add a homepage property in this format*: https://{username}.github.io/{repo-name} * For a project site, that's the format.
Author: gitname
Top answer
1 of 16
220

Here are the detailed steps needed to achieve this.

The existing commands can be simply run via the CLI terminal of VS-CODE. It is understood that Git is installed in the system, configured with desired username and email Id.

  1. Navigate to the local project directory and create a local git repository:

    git init

  2. Once that is successful, click on the 'Source Control' icon on the left navbar in VS-Code.One should be able to see files ready to be commit-ed. Press on 'Commit' button, provide comments, stage the changes and commit the files. Alternatively you can run from CLI

    git commit -am "Your comment"

  3. Now you need to visit your GitHub account and create a new Repository. Exclude creating 'README.md', '.gitIgnore' files. Also do not add any License to the repo. Sometimes these settings cause issue while pushing in.

  4. Copy the link to this newly created GitHub Repository.

  5. Come back to the terminal in VS-CODE and type these commands in succession:

    git remote add origin <Link to GitHub Repo> //maps the remote repo link to local git repo

    git remote -v //this is to verify the link to the remote repo

    git push -u origin master // pushes the commit-ed changes into the remote repo

Note: If it is the first time the local git account is trying to connect to GitHub, you may be required to enter credentials to GitHub in a separate window.

  1. You can see the success message in the Terminal. You can also verify by refreshing the GitHub repo online.
2 of 16
67

This feature was added in 1.45, demoed here.

Launch the command palette Ctrl+Shift+P, run Publish to Github, and follow the prompt. You will be given the choice between a private and public repository, so be careful that you choose the right one.

It may ask you to login to github. It will then prompt for the repo name (defaults to the name of the folder), and for creating a .gitignore file (defaults to empty .gitignore). Just hit enter if you are fine with the defaults. When you are done it should give you a popup notification in the bottom right with a link to the repo https://github.com/<username>/<reponame>

Minor warning: if your project already has a .gitignore file in it this process will overwrite it

🌐
TutorialsPoint
tutorialspoint.com › how-to-upload-a-project-to-github-from-vs-code
How to upload a project to GitHub from VS Code?
November 1, 2023 - Creating an account on GitHub is the next step. Do it by visiting here ... 4. Copy the URL of your repository once it has been created. With this URL, we can push code to this repository from Visual Studio Code.
🌐
GitHub
github.com › microsoft › vscode-docs › blob › main › docs › nodejs › reactjs-tutorial.md
vscode-docs/docs/nodejs/reactjs-tutorial.md at main · microsoft/vscode-docs
The {% data variables.product.prodname_vscode %} editor supports React.js IntelliSense and code navigation out of the box. ... create-react-app is no longer actively maintained. The React team now recommends using a framework like Vite (npm create vite@latest my-app -- --template react) or Next.js. The steps in this tutorial still apply to any React project setup.
Author: microsoft
Top answer
1 of 2
1

Since you want to add your 2 different projects in 1 repository, you can firstly put both of your project folder inside 1 main folder, example:

MyFolder:
  - MyReactProject
  - MySpringbootProject

here MyFolder is your main folder, which has both of your projects, react and springboot. then finally make a file inside MyFolder with name .gitignore, and put this line inside that file:

**/node_modules

what this file will do, is when you will push your code to github, it will ignore all the files and folders which are listed inside .gitignore file.


You Don't Need node_modules folder

when uploading your code somewhere online, you don't need to upload the node_modules folder, because this folder contains all the dependencies your project need, but when uploading your code online people can download those dependencies by calling the command npm install which will read all the modules needed from your package.json file, and download it on your machine.


To upload your code online you first have to authorize yourself on your local git program, to authorize yourself for github you can read this Article.

After authorizing yourself, firstly make a new empty github repository, by going to github or just by clicking this Link, after making a github repository open Terminal/Command Prompt in your Folder where both of your projects were, in this context my both projects were in MyFolder.

After opening Terminal/Command Prompt enter this commands:

git init
git branch -M main
git add .
git commit "Added all the files"

After running these commands, finally run these 2 final commands:

git remote add origin https://github.com/username/repository-name.git

here, replace username with your github username, and replace repository-name with the name of your repository you specified while make a new repository.

and finally run this command

git push -u origin main

and your code should be pushed on github.


If you don't want to use git commands you can also use, Github Desktop, but it is recommended you first learn basics of git and then use github desktop

2 of 2
1

There is a possibility that git is automatically initialized within your react project directory. Which means a .git folder is created, maybe that is the reason it cannot do drag and drop. This issue can be fixed by either delete the .git and again initialize using git init then you can add and commit your directory content. After that you should set the branch and add the remote repository using git remote add origin <repository-url> .
If there is any error i made or if there is any other useful method of doing so please let me know. Today is my first day in this platform and i would absolutely love to learn new things.
Thank you.

🌐
DevGenius
blog.devgenius.io › how-to-add-your-project-to-github-with-visual-studio-code-b311b57ad9d0
How to Add Your Project to GitHub with Visual Studio Code | by MP Codes | Dev Genius
October 6, 2023 - Visual Studio Code (VS Code): If you don’t have it installed, you can download it here. Git: Git is a version control system necessary for working with GitHub. You can download it from https://git-scm.com/. A GitHub Account: You need a GitHub account to create and store repositories. You can create one at https://github.com/.
🌐
DEV Community
dev.to › equuscaballus › how-can-i-download-a-react-project-from-github-and-run-in-my-pc-eh3
How Can I Download a React Project from Github and Run in My PC - DEV Community
October 4, 2020 - Hello Everyone I am new to Javascript and React. I was wondering if there is any way I can download some open source projects written in React JS from Github and run it in my computer with the help of Visual Studio code.I was thinking to study the source code so that I can learn React.
🌐
Techielass
techielass.com › how-to-push-code-from-vs-code-to-github
How to push code from VS Code to GitHub
October 23, 2025 - Select all the files you want to include in this commit and enter a descriptive commit message. Then, hit commit to save your changes. ... Head over to GitHub.com in your browser and create a new repository.