Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

Git clone with GitHub Desktop and terminal

Thomas Gumbricht bio photo By Thomas Gumbricht

Introduction

As you (most likely) do not have the right to edit, manage and update Karttur´s GitHub repositories and it’s GeoImagine Framework packages, you can not make use of Eclipse ability to stage, commit and push changes. It is instead recommended that you clone GeoImagine Framework using Git command line or GitHub Desktop to a stand alone project outside of Eclipse. And then import or copy the Framework project to Eclipse separately.

Cloning

The cloning done in this post (using GitHub Deskop or the command line tool git) is no different compared to using Eclipse as in the post on Git clone with Eclipse. But because you can not (unless you are me, TG) stage, commit and push changes back to the online GitHub repository, using Eclipse for cloning has no real point. In general GitHub Deskop is a superior app for Git management compared to Eclipse. And if you prefer to run Git from the commandline, then there is git).

Prerequisits

For cloning Karttur’s GeoImagine Framework from GitHub.com all you need is a GitHub account. You then either use GitHub Desktop or the git commandline tool.

Karttur’s GitHub repository

Go to GitHub.com, if you do not have an account it is free to create an account, and sign in. Go to Karttur’s repository containing the complete GeoImagine Framework (kt-gi-test01). This repository in more or less an empty shell with all the GeoImagine Framework packages linked as submodules. The top level of the repository only contains a few files.

Content of Karttur's GeoImagine Framework repository (top level).

If you drill down (by clicking), first to Karttur2019GitHub (the PyDev project) and then to geoimagine, you will see the list of all python packages beloning to the GeoImagine Framework.

Submodules belonging to Karttur's GeoImagine Framework repository (first submodules only).

Clone the GeoImagine Framework project

This tutorial covers three routes for cloning Karttur’s complete GeoImagine Framework to your local machine:

  1. Clone from online repository
  2. Clone directly from GitHub Desktop
  3. Clone using the git command line tool

Clone from online repository

In your web-browser, return to the top of Karttur’s assembled Framework project https://github.com/karttur/kt-gi-test01. Click the Clone or Download button and then click the Open in Desktop button. If you click “Download ZIP”, you will get a download but with empty submodules and this will not work.

Clone repository from GitHub.com

Your local copy of GitHub Desktop will start, and then guide you through the cloning process.

Clone directly from GitHub Desktop

Instead of linking to GitHub Desktop from the online GitHub repository, you can start your copy of GitHub Desktop and go via the menu:

File –> Clone Repository…

GitHub Desktop menu system, Clone Repository

In the window Clone a Repository that opens, fill in the Repository URL and the Local Path. When complete, press Clone.

Clone a Repository, GithHub Desktop

Clone using Git command line tools

Start a Terminal session. Change directory cd to the parent directory where you want to save the GitHub project (repository):

$ cd /Users/thomasgumbricht/eclipse/repos

If you accept that the repo you are going to clone will have the same local name as online (recommended), execute the command:

$ git clone https://github.com/karttur/kt-gi-test01

If you want the local clone to have another name, instead use:

$ git clone https://github.com/karttur/kt-gi-test01 karttur-geoimagine-01

To speed up the cloning of multiple submodules (up to 8 parallel downloads) and get all the linked submodule repositories cloned (version 2.13 and later) you should be able to execute:

$ git –recurse-submodules -j8 clone https://github.com/karttur/kt-gi-test01 [karttur-geoimagine-01]

But with Git version 2.16 it did not work out for me.

Check that the cloned repo actually contain all the GeoImagine Framework python packages. if not, cd to the top directory (kt-gi-test01 or karttur-geoimagine-01). Then execute the following commands for initiating and then updating all the the submodule linked repositories.

$ git submodule init

$ git submodule update

Update submodules

To update all submodules to latest individual commit of each, run the command:

$ git submodule foreach git pull origin master

import or copy project to Eclipse

Regardless of which route you chose for cloning the GitHub repo containing the PyDev project and packages, you should now have a complete, working, clone in your local machine. The next step is to either import or copy the Framework project to Eclipse.