How to add an existing project to github repository

Created at 07-Feb-2022 , By samar

How to add an existing project to github repository

Hello everyone, in this post we will look at how to solve "How to add an existing project to github repository" in programming.

We provide step by step instructions to add an existing project to the github repository. You just have to create a repository in the github account and use commands to add the project to the github repository.
  • Adding an existing project to GitHub

    //1. Login to the github account and create a repository using the following URL https://github.com/new
    I have logged in to my github account and created a repository with name myapp
    //2.In the command line, navigate to the root directory of your project.
    E:\laragon\www\my-app>
      
    //3. Step by step use the below command.
    >git init
    >git config --global user.email "YOUREMAILADDRESS@gmail.com"
    >git config --global user.name "YOURUSERNAME"
    >git remote add origin https://github.com/samarjeetsamar/myapp.git
    >git add .
    >git commit -m "first push"
    >git push -u -f origin master
    

    Additional info

    1. Please provide username and password asked by CLI after using git push -u -f origin master command.

    2. Provide access token instead of password while asking password in CLI.

Back to code snippet queries related git

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.