Cloning Remote Repository using GitHub Desktop

  • Estimate Completion Time
    not found 30 minutes
  • Difficulty Level:

Using GitHub Desktop, clone your remote repository into the local system. Make changes like add new files, update or delete files then commit those changes to the main branch. Then push those changes from the local repository to the remote repository.

Solution

For performing Git operations, GitHub Desktop is a user-friendly way that provides a graphical user interface to execute Git actions.

Step 1 - Clone a Remote Repository to Local System.

  • Download GitHub Desktop or Open GitHub Desktop.
  • Click on the File menu and choose “Clone repository”.
    Github Exercise - Cloning Remote Repository
  • In the pop-up window, a list of all repositories is shown. Choose a repository you want to clone into your local system.
  • Browse the local path where you want to clone the repository or choose the default location.
    Github Exercise - Cloning Remote Repository
  • Click on the “Clone” button.

Step 2 - Make changes to the cloned repository from the local system

  • Click on the Repository menu then Show in Explorer. It will navigate you to your local repository.
    Github Exercise - Cloning Remote Repository
  • Creating new files or documents as you would normally do into your local folders.
  • If you want to edit the file, open it and make changes. Then save it.
  • If you want to remove the files, then simply delete them from this local directory.

Step 3 - Commit changes to the main branch

  • Go back to GitHub Desktop; you’ll see the list of changes done in the left panel.
    Github Exercise - Cloning Remote Repository
  • At the bottom of the above list, there is a summary field and a description field.
    Github Exercise - Cloning Remote Repository
  • Write a summary i.e. title of the commit and a description i.e. detailed explanation of the commit which is optional then click on the “Commit to main” button to commit your changes to the local “main” branch.

Step 4 - Push Changes to Remote Repository

  • In the top bar of GitHub Desktop, you will see the push origin option to push your committed changes to the remote repository.
    Github Exercise - Cloning Remote Repository
  • Before pushing your changes in the local repository to the remote repository, make sure there are no conflicts. If there are some conflicts, GitHub Desktop will restrict you from making changes.
  • Resolve conflicts if any then do pull origin. Click on the Push Origin button. This will push all your committed changes from your local main branch to the remote main branch on GitHub.
  • Go to your remote repository on GitHub and see all the changes you have made from your local system will be reflected in the remote repository.
GitHub Practice Exercises - QA Ads Banner

Proleed Academy

Proleed serves / offers professionally designed IT training courses
globally.

Copyright © 2023 - Proleed Academy | All Rights Reserved.