Difference between revisions of "Import Java code examples using Git"

From Knowledge Kitchen
Jump to navigation Jump to search
(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...")
 
m
 
Line 3: Line 3:
  
 
== Overview ==
 
== Overview ==
Readymade code examples in Java for this course are publicly [https://github.com/bloombar/java-examples 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.
+
Readymade code examples in Java for this course are publicly [https://github.com/bloombar/java-examples available on GitHub], an online resource for sharing and collaborating on code.   
 +
 
 +
While it is certainly possible to copy/paste code from these examples, there is a better way to download them and keep them up-to-date as new examples are added using a code versioning and sharing tool called Git.  Note that if you are using Eclipse, there are [[Import Java code examples into Eclipse using Git|separate instructions for downloading these Java examples into the Eclipse environment]].
  
 
== Assumptions ==
 
== Assumptions ==

Latest revision as of 12:45, 12 September 2019


Overview

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 from these examples, there is a better way to download them and keep them up-to-date as new examples are added using a code versioning and sharing tool called Git. Note that if you are using Eclipse, there are separate instructions for downloading these Java examples into the Eclipse environment.

Assumptions

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:

git pull


What links here