COMS W4995 C++ Deep Dive for C Programmers

Working on a non-SPOC machine

Working in SPOC is the normal and recommended way to do your labs in this class. This guide is not necessary by any means. In fact, if you choose to work on your own machine, you are on your own. We do not support it. You cannot claim “it worked on my machine” when your lab didn’t compile on SPOC. (That’s actually the main reason we have SPOC.) This method is also recommended only for those who are very comfortable with Git.

First, you must SSH into SPOC and configure Git so that you can push from your local machine to SPOC. You can set this up using the following command:

git config --global receive.denyCurrentBranch updateInstead

You only need to perform this step once. Failure to perform this step will result in errors when running git push on your local machine.

After that, clone the lab to your SPOC account as usual. Then, on your local machine you can clone your lab repository using the following command:

git clone UNI@spoc.cs.columbia.edu:~/c2cpp/labN ~/local/path

You can now work on your local machine. When you’re done, push to the SPOC Git repo using git push. Then, you submit from your Git repo on SPOC.

The caveat here is that you must keep the two repositories in sync: the easiest way to do this is to always commit and push from your local machine after cloning. If the repository on SPOC is ahead of your local machine in commits, or if you have untracked or uncommitted changes on SPOC, git push will fail on your local machine.

Also note that you will not be able to push from SPOC to your local machine using this method. This will only work in one direction (from your local machine to SPOC). These steps do not configure your local machine to receive pushes, and the Git repository on SPOC will not know where to push to.


This guide was originally written by Nelson Gomez, Jae Woo Lee, and Kundan Guha.

Ivy Basseches, Tal Zussman, and John Hui adapted it for the web in Fall 2022.

Last updated: 2022-09-14