Enterprise Java Development@TOPIC@
You will use Git in this class to perform an initial checkout and get updates for source files. Any Git client should be able to perform that function. You can determine if you have a command line Git client already installed using the following simple command.
There are a number of options and some are going to be based on on your platform. Your basic options include command line or using an Eclipse plugin
Eclipse GUI Users: There is a git plugin for Eclipse available called EGit. It automatically comes with Eclipse these days, so no extra installation is required.
Linux Command-Line Users: Use your package installer. Select git-core, gitk, and git-gui packages.
Cygwin Command-Line Users: Use the cygwin setup tool to locate the git packages
Windows Command-Line Users: Git comes in a core layer and then OS-layer add-ons. The core layer is sufficient for class and can be found at http://msysgit.github.io/
Download and launch the installer
Accept the default installation option of "Use Git Bash bash only". As the prompt states, it has the least risk and will be suitable for the minor amount of use required in class.
Chose your checkout style. Don't worry about commit style you will only be performing read-only checkouts. I chose "Checkout as-is, commit Unix-style line endings" since I used all linux-style editors on Windows. You may want the Window checkout format.
Click on the "Git Bash" icon after the installation is complete.
The class repository is located on github and can be browsed using the following http URL https://github.com/ejavaguy/ejava-student. With a cloned copy, you can receive file updates during the semester.
CD to a directory you wish to place source code. Make sure the path to this directory contains no spaces.
Clone the class repository using the following URL git://github.com/ejavaguy/ejava-student.git
$ git clone git://github.com/ejavaguy/ejava-student.git Cloning into 'ejava-student'... ... Checking out files: 100% (1289/1289), done. ... $ ls ejava-student/ ... $ cd ejava-student $ git branch -a //list all branches -- local and remote * master remotes/origin/HEAD -> origin/master remotes/origin/master
Git leaves you with all branches fetched and a local master branch referencing the class' master branch on github. You will be using the master branch for the duration of the semester. Other branches may show up, including my working branches where I am actively working on the next wave of updates. The master branch is usually updated the evening before or the day of class and should always be stable.
Perform a mock update. This is what you will be doing several times this semester to get file updates.
$ git checkout master //switches to master branch $ git pull //downloads changes and attempts merge Already up-to-date.
There are many modules within the class repository. Some are ready for use, some are still being worked, and some are not for use this semester. The ones ready for your use will be wired into the build and will be compiled during a follow-on section. The list will increase as the semester moves forward. Please ignore these extra modules. Keeping them within the baseline helps me keep related things centralized.
If you ever make changes to the class examples and would like to keep those changes separate from the updates. Store them in a new branch at any time using the following git commands.
$ git checkout -b new-branch #creates new branch from current branch #and switches to that branch $ git commit -am "saving my stuff" #commits all dirty files to new branch $ git checkout master #switches back to the master branch
If you simply want to throw away any changes you made, you can discard those changes to tracked files using the following git commands.
$ git reset --hard master $ git clean -rn //shows you what it would delete without deleting $ git clean -rf //deletes files not managed or specifically ignored by git