Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

Git clone with GitHub Desktop or 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 (unless you fork the original GeoImagine project to your own git online repo). It is instead recommended that you clone GeoImagine Framework using git command line or GitHub Desktop to a stand alone clone outside of Eclipse. And then transfer the Framework project to the development environment you prefer. How to import or copy to Eclipse) are covered in separate blog posts.

Cloning

The cloning done in this post (using GitHub Deskop or the command line tool git) resembles using Eclipse as in the post on Git clone with Eclipse. 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 an app that can clone the GitHub super-repo linking together all the packages that build the GeoImagine Framework. The alternatives are GitHub Desktop if you prefer a GUI, or the git commandline tool.

Karttur’s GitHub repository

Go to GitHub.com and to Karttur’s repository containing the complete GeoImagine Framework (geoimagine03frame). This repository is more or less an empty shell with all the GeoImagine Framework packages linked as submodules. The top level of the repository is composed of 4 files; the standard README.md and LICENCE files, a shell script addsubmodules.sh and then the git file .gitmodules. The last file defines all the linked submodules that you see as blue sub-directories.

GitHub repo for Karttur's GeoImagine Framework, showing the first submodules.

Clone the GeoImagine Framework project

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

  1. Clone by linking to GitHub Desktop for online repo,
  2. Clone directly from GitHub Desktop, and
  3. Clone using the git command line tool

Download from online repository does not work

In your web-browser, return to the top of Karttur’s assembled Framework project https://github.com/karttur/geoimagine03frame. If you click “Download ZIP”, you will get a download but with empty submodules and this will not work.

Clone via GitHub repo using GitHub Desktop

In the web-browser with the Framework superproject, click the Clone or Download button and then click the Open in Desktop button.

Clone repository from GitHub.com

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/”youruser”/eclipse/git

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/geoimagine03frame.git

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

$ git clone https://github.com/karttur/geoimagine03frame.git [“alt name”]

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):

$ git clone –recurse-submodules -j8 https://github.com/karttur/geoimagine03frame.git [karttur-geoimagine-03]

Check that the cloned repo actually contain all the GeoImagine Framework python modules (.py files). if not, cd to the top directory (geoimagine03frame or karttur-geoimagine-02). 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 main

import or copy project to Eclipse

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