Git uploads files to Github

  1. You need to generate a key for your local Git and use this key to configure the SSH key

    Ssh-keygen -t rsa -c “[email protected]

    Save the file by default, go to the command line to find the file id_rsa.pub, and then use notepad to open and copy it. This is the public key we need next

  2. Open Github, find setting, click SSH and GPG keys, click NEW SSH key, insert the public key into the corresponding key, and then name it randomly, so that you can directly upload local files from Git to Github

  3. Create a repository on Github. The default Settings will show the repository’s address, which we will use later

  4. Locate the local directory where you want to upload files, right-click to open it using git Bash, and type the following commands in sequence

    -git commit -m "Commit info" commit to local repository -git push -u origin Github repository address (the repository address mentioned above can be copied directly to here)Copy the code
  5. When you open Github, you can see that all the files have been successfully uploaded to Github