Using Git for the Interpreters Project
Setup, Iteration 6
Again, a repository has already been created for you.
You cannot do this until I have add your public key to the git server on csforge.
If you're running Eclipse, exit out of it first.
Clone the Remote Repository
First, you have to clone the git repository from csforge:
In your home directory.
unix-% cd eclipse-workspace-directory unix-% git clone git@csforge.calvin.edu:jdfrens_interpreter.git
First get into your own workspace directory; you should see the folder for your Eclipse project. And use your username instead of mine!
unix-% cd jdfrens_interpreter
Stay in this jdfrens_interpreter
folder until
the very end!
Copying Stuff Over
Let's say you named the original project CS214
:
unix-% cp -R ../CS214/* . unix-% cp ../CS214/.classpath . unix-% cp ../CS214/.project .
Preemptively Fixing Problems
Eclipse puts all the class files in the bin
folder.
Those are artifacts that can easily be recreated from the source
code, so they shouldn't be taking up disk space (and bandwidth) in
a repository.
Put bin
in a new ./.gitignore
.
Add the Content to Git
unix-% git add .
I didn't have anything to tweak in the staging, so don't be surprised if there's nothing for you.
Look over the list to make sure that the staged files really
should be in the repository. Use git rm -f
to remove
files that shouldn't be staged, and create .gitignore
files to ignore properly.
Committing
unix-% git commit
I used initial commit at the end of week 2
for my
commit message. Tweak yours to indicate where your code stands.
Pushing to the Remote Repository
unix-% git push
Future Workflow
Again, use add
, commit
, and
push
to manage this project. While there is a git
plugin for Eclipse, I don't recommend it (yet). You need to use the
command-line git for your language iterations.
In Eclipse
- Select File -> Import....
- Select General -> Existing Projects into Workspace, and hit Next.
- Select Select root directory, and
Browse... to your
jdfrens_interpreter
folder. - Hit Finish.
You'll now see jdfrens_interpreter
as an Eclipse
project. Run the tests from this project, and try the
./script/hobbes
script. If they work, you can delete
your original project and rename
jdfrens_interpreter
.