Create a master git repo on the ssh.ece server

In order to complete these steps, you need to have an account on the ssh.ece.ubc.ca server. If you do not have an account, contact your course staff. Login to ssh.ece.ubc.ca by opening a terminal on your computer and typing:

  $ ssh username@ssh.ece.ubc.ca

Change into the directory where you would like your OS161 git repository to reside. Keeping it in your top-level log in directory is also fine. Next type:

  $ git clone --bare -b master git@dev.ece.ubc.ca:OS161 os161.git

This will create your own repository containing a clone of the OS161 source tree. The source code came from the server dev.ece.ubc.ca. You are allowed to pull from that server, but not to push there. Instead, you will push the code you write into the repository you have just created. (Therefore, you will create another clone of that repository, but more on that later.)

The repository you just created does not have a working directory structure (we accomplished this with the "bare" option). So you cannot modify the code in that repository. This is exactly what you want: the repository you have just created will only hold your committed code. Your working code will live in another clone (with working directories) that you will create in the next step.

After this step is complete, the directory os161.git will have all the files needed to use your repository. Treat these files very carefully, don't accidentally delete them. If you delete them, the entire repository on this server will be gone.

Congratulations! You now have set up your own git repository. By the way, this is exactly the same steps that you would follow if you wanted to set up a git repository for your own development team. For more information on setting up git repositories on a server, read here.

Before proceeding to the next step, you need to figure out your clone URL. There are many ways to access git repositories; via ssh, http, https or the git protocol. For this course, we will access the repository via ssh and use ssh for authentication and the UNIX file system for managing permissions permissions. To figure out your clone URL, change into the same directory where you executed the previous git clone command and type:

 $ pwd

This command will display a path to the parent directory that contains your master repository: the os161.git directory. If we use a variable DIR for the displayed working directory, your clone URL would be:

username@ssh.ece.ubc.ca:/DIR/os161.git

For example, if the parent directory for your os161.git repository is something like this:

  /ubc/ece/home/username/OS161
 

Then your clone URL will be:

  username@ssh.ece.ubc.ca:/ubc/ece/home/username/OS161/os161.git
Remember this URL, because you will need it to clone your repository, so you can develop code in it.