How to Connect Git to GitHub | Scribe

    How to Connect Git to GitHub

    • |
    • 0 step |
    • 49 seconds
      We'll start by creating a new repository on GitHub. Do this by clicking the Plus sign next to your GitHub profile.
      Hit New repository
      Give your repository a name and an optional description. Do not add a readme or license yet. This will avoid any unnecessary errors.
      Click Create repository
      Next, open "Terminal"
      The remainder of the process is a series of commands. To start, navigate to the directory of your project, and initialize the local directory as a Git repository by typing the following command: "git init -b main" and hit [[Enter]]
      Next, add files to the staging area and make your first commit message by entering the following two commands: "git add ." [[Enter]] "git commit -m "message"" [[Enter]]
      Return to your GitHub tab and copy the remote repository URL by clicking the copy button.
      Next, we'll paste the into the terminal along with the following command: git remote add origin <put your remote URL here> [[Enter]]
      Verify the new remote URL with the following command: "git remote -v" [[Enter]]
      Finally, we can push changes to finalize everything. Enter the following command to complete the process: "git push -u origin main" [[Enter]]
      Was this Scribe helpful?
      Save this document for future reference.
      This Scribe is in tip-top shape!Leave feedback if there are any issues with this Scribe