This guide was created with Scribe in 49 seconds. Sign in and create your own!
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.
Zoom Saved
2
Hit New repository
Zoom Saved
3
Give your repository a name and an optional description. Do not add a readme or license yet. This will avoid any unnecessary errors.
Zoom Saved
4
Click Create repository
Zoom Saved
5
Next, open "Terminal"
Zoom Saved
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]]
Zoom Saved
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.
Zoom Saved
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]]
Was this Scribe helpful? Save this document for future reference.
Save for Later
Have something to say?Create an account to leave messages for the author to see!Create an account
Feedback
This Scribe is in tip-top shape!Leave feedback if there are any issues with this Scribe