How to Connect Git to GitHub | Scribe

    How to Connect Git to GitHub

    • |
    • 11 steps |
    • 49 seconds
      1
      We'll start by creating a new repository on GitHub. Do this by clicking the Plus sign next to your GitHub profile.
      2
      Hit New repository
      3
      Give your repository a name and an optional description. Do not add a readme or license yet. This will avoid any unnecessary errors.
      4
      Click Create repository
      5
      Next, open "Terminal"
      6
      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]]
      7
      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]]
      8
      Return to your GitHub tab and copy the remote repository URL by clicking the copy button.
      9
      Next, we'll paste the into the terminal along with the following command: git remote add origin <put your remote URL here> [[Enter]]
      10
      Verify the new remote URL with the following command: "git remote -v" [[Enter]]
      11
      Finally, we can push changes to finalize everything. Enter the following command to complete the process: "git push -u origin main" [[Enter]]