Skip to content

Getting started with Git

Robbi Bishop-Taylor edited this page Feb 19, 2025 · 30 revisions

Getting started with Git

Saving your work on dea-notebooks

If you are accessing dea-notebooks via the DEA Sandbox or National Computational Infrastructure and wish to save your work between sessions, you will need to either clone a copy of our default resources or download your work each session. This is required because changes made to Jupyter notebooks in the DEA Sandbox or NCI environment may be overwritten as part of regular automatic updating, meaning any changes you make may be lost.

To create a personal copy of dea-notebooks, you will need to get started with Git - a version control system that supports collaboration on code-based projects by intelligently tracking changes in files.

Read more about GitHub and Git.

Sign up for a free GitHub.org account

The Creating an account on GitHub guide will help you to set up a free GitHub account, allowing you to create personal copies of dea-notebooks and contribute your own code back to the repository.

To work with Git and dea-notebooks, you can complete your Git-related actions directly in the github.com browser and via the command line in the DEA Sandbox and NCI environment. DEA Sandbox also has a Git toolbar in the left-hand workbench menu that simplifies many git tasks, eliminating most of the need to work on the command line.

Getting your own copy of dea-notebooks

To avoid losing your work between DEA Sandbox (or NCI) sessions, you will need to:

  • "Clone" or create a copy of the dea-notebooks repository into a new folder
  • Create a new "branch" of the repo which serves as a personal workspace where you can work on code until you are ready to submit it back to dea-notebooks

To do this inside the DEA Sandbox:

  1. Log in or sign up to the DEA Sandbox.

    The sandbox will contain the Notebooks from the stable branch of the dea-notebooks repository. Learn more about the DEA Sandbox.

    The Launcher application in the Sandbox. The notebooks are listed in the sidebar.

  2. Open a new command-line terminal by clicking the blue "+" (New Launcher) button in the top-left corner to open the Launcher then click to open the Terminal. This is a Linux terminal for your Sandbox environment.

  3. Navigate to your home directory by typing the following:

    cd ~
  4. Clone a copy of dea-notebook's 'develop' branch into a new folder called dev by typing the following:

    git clone --depth 1 --branch develop https://github.com/GeoscienceAustralia/dea-notebooks.git dev
  5. Then, change into this folder as follows:

    cd dev
  6. Finally, create a new branch with a name of your choice (replace 'your-branch' with a relevant branch name to you).

    git checkout -b your-branch develop

You will now have a persistent version of dea-notebooks where your changes will not be overwritten by automatic updates. Don't forget to regularly compare to the default notebooks to check for updates and changes. You can do this by manually comparing to the top level notebooks in your DEA Sandbox directory or you can explore Git options to do this. This Git cheatsheet can help you get started.

Clone this wiki locally