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:
- Login into your Github account at https://www.github.com.
- After you have logged-in, click on the project you want to clone.
- 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.
- Next, open terminal and go to the directory where you want to copy the project. Use the following command to clone the project:
- Next, navigate inside the cloned project folder
- Next, execute the following command from inside the cloned project folder to update all remote-tracking branches:
- To view the current remote branches, execute the command below:
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.
Example: cd keycloak-sample
git branch --remotes