Difference between revisions of "Import Java code examples using Git"
(Created page with "Category: Java Category: Computer Science == Overview == Readymade code examples in Java for this course are publicly [https://github.com/bloombar/java-examples avail...")
Revision as of 13:43, 12 September 2019
Readymade code examples in Java for this course are publicly available on GitHub, an online resource for sharing and collaborating on code. While it is certainly possible to copy/paste code, there is a better way to download it and keep it up-to-date as new examples are added using a code versioning and sharing tool called Git.
This document assumes you are running a UNIX-like command shell, such as Terminal on Mac or Git Bash on Windows, and you are familiar with basic UNIX commands.
Choose a directory in which to store the examples
Decide in which directory you would like to store the example files, and then make that your current working directory.
Download the examples
Run the following command to download all the examples for the first time:
git clone https://github.com/bloombar/java-examples.git
Download any updates to the examples
From time-to-time someone may add new examples or modify the existing examples. In order to update your local copy such that you have the latest, download any changes by first navigating into the directory that was automatically created when you first downloaded the examples, and then running the following command: