Git Clone

The clone command copies a project form an existing remote Github repository to your local repository.

Follow these steps to clone a project from a remote git repository to your local repository:

  1. Login into your Github account at https://www.github.com.
  2. After you have logged-in, click on the project you want to clone.
  3. On the project page, click on the clone button, a dropdown will be shown with options to clone with HTTPS and SSH. Select clone with HTTPS and copy the address.
  4. Next, open terminal and go to the directory where you want to copy the project. Use the following command to clone the project:
  5. 
        git clone <remote repository https address>
        

    Example: git clone https://github.com/tutorialsbuddy-hello/keycloak-sample.git

    NOTE: You may be prompted for your username and personal access token if you are cloning from a private Git repository.

  6. Next, navigate inside the cloned project folder
  7. 
        cd <project-folder>
        

    Example: cd keycloak-sample

  8. Next, execute the following command from inside the cloned project folder to update all remote-tracking branches:
  9. 
        git fetch
        
  10. To view the current remote branches, execute the command below:
  11. 
        git branch --remotes