Cloning, Staging, and Committing
Explore the process of cloning GitHub repositories locally, staging changes, and committing code to track your project development. Understand how to initialize repositories, use command-line Git operations, and manage version control with practical examples.
We'll cover the following...
Cloning the repository
To begin adding and editing code related to this repo, you’ll now have to clone the repo. Cloning copies the entire GitHub repo to your local development environment.
To clone the GitHub repo to your local environment:
-
Navigate to the NoBSautomation repository (or whatever name you called the repo earlier).
-
Click the green Clone or download button. You will then be presented with two options: an HTTPS URL to copy and clone with and a Use SSH link to show the SSH to copy and clone with.
-
Let’s use the Clone with HTTPS option. This is the URL you will use to manually clone the repo via the local Git client.
-
Open a command prompt or PowerShell terminal as an administrator. The project will be cloning the GitHub repo to the desktop of the logged-in user (Michael), which will create a local folder on the desktop. However, you can choose any path you’d like.
-
With the copied HTTPS URL, run the command
git clone <https url>. Thegit clonecommand ...