Adding a local repository to GitHub using Git

 https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github

Before you can add your local repository to GitHub using Git, you must authenticate to GitHub on the command line. For more information, see About authentication to GitHub.

  1. Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub. For more information, see Creating a new repository.

  2. At the top of your repository on GitHub's Quick Setup page, click  to copy the remote repository URL.

    Screenshot of the "Quick Setup" header in a repository. Next to the remote URL, an icon of two overlapping squares is outlined in orange.

  3. Open Git Bash.

  4. Change the current working directory to your local project.

  5. To add the URL for the remote repository where your local repository will be pushed, run the following command. Replace REMOTE-URL with the repository's full URL on GitHub.

    git remote add origin REMOTE-URL
    

    For more information, see Managing remote repositories.

  6. To verify that you set the remote URL correctly, run the following command.

    git remote -v
    
  7. To push the changes in your local repository to GitHub, run the following command.

    git push origin main
    

    If your default branch is not named "main," replace "main" with the name of your default branch.

Không có nhận xét nào:

UseQuery React for Efficient Data Fetching

 https://daily.dev/blog/usequery-react-for-efficient-data-fetching If you're diving into React and looking to manage data fetching effic...