Cloning a git repository means copying it from the GitHub website to your local machine. After cloning the git repository onto your machine you can make changes to it, add whatever modules you want to add or remove whatever modules you want to remove. The changes made into this repository will not reflect in the repository hosted by GitHub so you have full control of cloned repository in your hand. So let’s see how to clone the repository.
Open the browser and search for any repository that you want you clone, I have selected the tailwind CSS repository. Go into the repository and click on the green-colored Code button you will get an HTTPS link, copy that link as shown below.
I have opened my git bash terminal into Desktop use following command to clone your desired directory.
git clone copied_repository_url
git clone copied_repository_url Folder_Name
Above command will clone git repository into given Folder Name. Below TWC is my folder name.
After cloning the remote git repository successfully get into that folder Right Click and open git bash there. Now if I run git status over there then it will show Working Tree Clean.
Open README.md file and make some changes into it now if I run git status command it gives me following result as I have changed README.md file.
Add README.md into Staging Area using git add –a command and then commit the changes using git commit -m “Your Commit Message” command. This commit will not reflect any changes in the remote git repository it will make changes in the local git repository only. You can perform any operations on this local repository.
To see the changes made by other authors on this particular repository use following command.
Git Log command returns commit made by authors, their email addresses, date and time of a commit, and commit messages of that repository. Git log command returns this information because of the .git folder which we have downloaded while cloning the repository.