Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Git Tutorial 9 – Git Clone – Get Local Copy Of Remote Repository

Posted on 03/16/2025 By admin

As a part of GIT Tutorials End To End, we will learn about another frequently used and important git command “git clone“ in this post.

If you are a beginner in GIT concepts then I will recommend going through the below posts to understand GIT much better.

Git Tutorial 4 – Create A New Git Repository – Git Init Command

Git Tutorial 5 – Know The State Of Working Directory – Git Status

Git Tutorial 6 – Git Add – Add Changes From Working Directory To Staging Directory

Git Tutorial 7 – Git Commit – Save Staging Directory Changes To Local Repository

Git Tutorial 8 – Git Push – Upload Committed Local Repository Changes To Remote Repository Branch

If you want to learn more basic concepts of GIT then please follow the below link:-

GIT Basics Concepts

Did you know that I have started a YouTube channel as well and I need your support to make it successful. Please do watch content then comment, like, share, and obviously subscribe.

Understand a scenario. There might be many developers in a project and they will have a remote repository where codes from all developers will be merged together and stored. You are a new addition to the team and obviously, you need to start contributing to the same existing remote repository. For this, you need to have a local copy of the remote repository in your local system. This can be done using the “git clone” command.

We have already created a remote repository in the previous post. I will clone the same remote repository in my local system. Please note although I already have a local repository of that remote repository, I can create several local repositories of the same remote repository on the same system.

git clone

Create a new directory and run “git status” command.

As the newly created directory is not a git repo we see an error message as above. Now switch to a newly created directory and run the “git clone” command with a remote URL.

As the above remote repository is a public repository it will not ask for any credential details. Now you can go to the created folder where you can see remote repository content has been copied in folder “dummyrepo1” which is the remote repository name. In the remote repo, we have a file “myFile1.txt” which you can see in your local repo now.

If you run “git status” command now you will not see the error as above.

In fact, this cloned local repository is a full-blown local copy of the remote repository and it will have all commit histories. You can run the “git log” command to see all existing commits.

You can verify the above commits from BitBucket. BitBucket shows the first 7 characters of commit id.

When we cloned a remote repository above you must have noticed that a new folder “dummyrepo1” which is actually a remote repo name, was created. That is actually not needed or redundant if you are creating a directory first and then navigating to it and cloning the repo. You can use options with “git clone” command so that the repo will be cloned in the desired folder directly.

git clone

I did not create any directory first. I directly passed the desired directory name with the git clone as the last parameter (myRemoteRepoName in the above screenshot). Files were directly copied in the directory instead of creating another folder with a remote repo name.

Please subscribe to my YouTube channel Retarget Common to learn from my video tutorials.

Below are important end to end tutorials for Testers:-

Selenium Tutorials

Rest Assured Tutorials

Postman Tutorials

TestNG Tutorials

If you have any doubt, feel free to comment below.If you like my posts, please like, comment, share and subscribe.#ThanksForReading

#HappyLearning

Uncategorized

Post navigation

Previous Post: Postman Tutorial Part 54 – Testing SOAP API(WSDL) Using Postman
Next Post: TestNG Tutorials 55: DataProvider in TestNG – Lazy Initialisation of DataProvider Method – Use of Iterator Return Type

Related Posts

learn with quiz Uncategorized
image – Make Selenium Easy Uncategorized
TestNG Tutorials 54: DataProvider in TestNG – Implementing Object Oriented Concept “Encapsulation” with DataProvider Method Uncategorized
PostmanAppDownload – Make Selenium Easy Uncategorized
TestNG Tutorials 49: Need of DataProvider Method in TestNG | Make Selenium Easy Uncategorized
Frequently Asked Java Program 24: Java Program to Capitalize First Character of Each Word in a String Sentence | Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark