GitHub creates a repository and establishes a link to the local one

  1. After registering and logging in to your account, click 2 in the upper right corner.
  2. Click [Your repositories]
  3. Create a new library



    and you will get ↓↓
  4. Go to the local project folder you want to upload, right-click [Open in Terminal]


     
  5. Just copy and paste the prompts in the library created in step three, as shown

    below:


     
  6. Then push the local file to the library.
     
  7. If you encounter the following error during the push process:

     
    On branch main
    Your branch is up to date with 'origin/main'.
    
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            .gitignore
            .vscode/
            index.html
            package-lock.json
            package.json
            public/
            src/
            vite.config.js
    
    nothing added to commit but untracked files present (use "git add" to track)

    This prompt means that your current Git branch is mainand there are some untracked files in your local repository. Untracked files refer to files that are not managed by Git and are usually newly added files.
    If you want to add these files to Git version control, you need to perform the following steps:

Guess you like

Origin blog.csdn.net/Smile1552911411/article/details/132670400