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 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
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
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
username@ssh.ece.ubc.ca:/DIR/os161.git
For example, if the parent directory for your
/ubc/ece/home/username/OS161
Then your clone URL will be:
username@ssh.ece.ubc.ca:/ubc/ece/home/username/OS161/os161.gitRemember this URL, because you will need it to clone your repository, so you can develop code in it.