To Set Up Your Athena Workspace for 6.170

  1. Log in to Athena and bring up a terminal. To do it remotely, SSH to athena.dialup.mit.edu. See IS&T Remote Athena Help if you're having trouble.
  2. To set up your repository for 6.170, run the command:
    python /afs/csail.mit.edu/proj/courses/6.170/repos/create_repo.py
  3. Once your repository is all set up on our end, you can get things ready on your workstation. If you have windows, you'll need to install Git first, and then use the git terminal to do the upcoming commands. Otherwise use the standard system terminal.
    In a terminal, navigate to wherever you want your code to be stored (say, on your laptop under Classes/6.170/, or on athena, or both, or wherever!). Then, run the following commands, being sure to replace MY_USERNAME with your athena username:
    git clone ssh://MY_USERNAME@athena.dialup.mit.edu/afs/csail.mit.edu/proj/courses/6.170/repos/MY_USERNAME.git 6170_code
    cd 6170_code
    git remote add handoutcode ssh://MY_USERNAME@athena.dialup.mit.edu/afs/csail.mit.edu/proj/courses/6.170/repos/handoutcode.git
    git checkout dev
    git pull handoutcode master
    You should be prompted for a password twice, once after the first command ("git clone") and once after the last command ("git pull"), where you'll have to enter your athena password. As a check to make sure you can submit your code, go ahead and add a special message in the README file and then run
    git push origin dev:submit

To Complete an Assignment

  1. Go into terminal and navigate to wherever you cloned your repository and run:
    git pull handoutcode master
    to make sure you have the most up to date handout code for the assignment. Be sure that you're in your "dev" branch when you pull.
  2. You can now start working on the assignment. The work for Assignment 1 will go in the folder "assignment1", the work for Assignment 2 in "assignment2" etc.; these folders should already have been created for you if you pulled the handed-out code correctly.
  3. While your work progresses, you can make commits to your working repository. See the git reference below for how to do this. Remember, however, that these commits are only local to your computer. To back them up to the server, run
    git push
    When your work is in such a state that you wish to submit it, issue the following command:
    git push origin dev:submit
    You can do this as many times as you want before the deadline for each assignment. We will fetch the last commit before the deadline for grading. (Still, we don't guarantee that we won't use a slightly later commit, so don't push a commit that breaks your code right after the deadline either). Note that you might get your repository into a weird state where it complains about the push not being a "fast-forward" commit, or similar. In this case, you have to force git to comply by using
    git push origin +dev:submit

Git Reference

Once a git repository is set up and you have CDed into it's directory, these are the most frequently used git commands: