How to add an existing project to github repository

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.

Answers 1
  • Adding an existing project to GitHub

    //1. Login to the github account and create a repository using the following URL
    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.
    //3. Step by step use the below command.
    >git init
    >git config --global "[email protected]"
    >git config --global "YOURUSERNAME"
    >git remote add origin
    >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