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.
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.
At the top of your repository on GitHub's Quick Setup page, click to copy the remote repository URL.
Open Git Bash.
Change the current working directory to your local project.
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.For more information, see Managing remote repositories.
To verify that you set the remote URL correctly, run the following command.
To push the changes in your local repository to GitHub, run the following command.
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:
Đăng nhận xét