forked from cs109/2015lab1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
120 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1896,11 +1896,31 @@ | |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The homeworks work by us creating repositories for each student of the signature `studentid-2015` on github. You will clone these. Initially you will find `master`, `hw0`, and `hw1` branches. You will checkout a homework branch and work on it, adding, comitting, pushing. Thats it. When its time for your next homework, we'll push, say, a `hw2` branch to your repositories `origin` remote on github. You will fetch this new branch, checkit out, and work on it. And rinse and repeat.\n", | ||
"To make `hw0.ipynb` easily accessible, we added it to the public lab repo, so that you can read it even without having a github account. (Otherwise we would have a chicken and egg problem.). This is because our homework repository is private, and we have set it up so that your repositories are private as well.\n", | ||
"\n", | ||
"DO NOT work on any files like `hw1_original.ipynb`. If there are any changes you will be able to incorporate them into the `hw1_original.ipynb` file from the `course` remote without clobbering your own work in `hw1.ipynb`.\n", | ||
"Nevertheless, we want you to get acquainted with the workflow you must execute in order to obtain and submit homeworks. \n", | ||
"\n", | ||
"The `master` branch only contains instructions. You shouldnt be working on it.\n", | ||
"Let me first describe the steps by which you gain access to the homework.\n", | ||
"\n", | ||
"1. At the beginning of this document you were asked to obtain a github id and enter it in the mandatory survey. We will use this github id to construct a homework repository for you with read-write access, and give you access to our read-only homework repository. You will be added to a github organization `cs109-students`.\n", | ||
"2. Our read-only repository is `cs109-students/2015hw`. All students have read-only access to this repository. It will serve the job of the `course` remote, like above. Any changes after the homework has gone out will be made here.\n", | ||
"3. You will have your own read-write repository under the `cs109-students` organization, which will be of the form `cs109-students/userid-2015hw`. Only you and the cs109 staff have access to this repository, thus ensuring the privacy of your homework.\n", | ||
"4. When each homework is released, we will create a **branch** on your remote repository, `cs109-students/userid-2015hw`. The branches are, unimaginatively named: `hw0`, `hw1`,...,`hw5`. (For the curious, the way this works is by us creating one remote per student for a local clone of our `cs109-students/2015hw` repository, and pushing the new branch to it. We only push to a new branch each time as we dont want to be messing with a branch you have already worked on.). There is `master` branch too, which will have some instructions, but nothing very exciting. You will never work on this branch.\n", | ||
"\n", | ||
"So now, how to you obtain and submit the homework? You wont be forking here.\n", | ||
"\n", | ||
"1. You first make a clone of your repository. From the terminal, you issue the command: `git clone [email protected]:cs109-students/userid-2015hw.git` (for ssh users) or `git clone https://github.com/cs109-students/userid-2015hw.git` (for https users). Substitute your own userid for `userid`.\n", | ||
"2. Next you add a remote `course` to track the read-only \"guru\" repository. The command for this is: `git remote add course [email protected]:cs109-students/2015hw.git` or `git remote add course https://github.com/cs109-students/2015hw.git`. This well help to incorporate any changes, just like above.\n", | ||
"3. Your clone will come with a `master` branch, and perhaps a `hw0` branch. In either case you should first do `git fetch origin hw0`, which fetches from *your* remote repository on github the `hw0` branch. Then you issue `git checkout -b hw0 origin/hw0`. This command makes a new local branch `hw0` on your machine which tracks the `hw0` branch on your remote.\n", | ||
"4. You are now in the `hw0` branch. This is where you will work on homework 0. Start the ipython notebook in the repository and run the homework. The file you will use is `hw0.ipynb`. DO NOT run the notebook ending in `_original.ipynb`. These are simply copies of the homework. We made these copies so that you can update them from our `course` remote in case we make any changes. You will now engage in the \"add/commit/push\" cycle as described above. (The `push` will only push to the remote `hw0` branch.)\n", | ||
"5. We'll grade the last commit you make before the homework deadline. We will be looking for the file `hw0.ipynb`. (In actuality we wont grade homework 0 but check that you submitted it. But we will be using this mechanism to grade the homeworks from homework 1 onwards.)\n", | ||
"6. When we are ready to send out homework 1 to you, we will create a new branch on your remote repository `[email protected]:cs109-students/userid-2015hw.git` on github with the name `hw1`. You will now repeat the process from step 3 onwards: `git fetch origin hw1` followed by `git checkout -b hw1 origin/hw1`. Then you work on the `hw1` branch, and engage in the \"add/commit/push\" cycle by running `hw1.ipynb`. And so on...\n", | ||
"\n", | ||
"Once again, in case we make changes, you can incorporate them into your repo by doing: `git fetch course; git checkout course/hw0 -- hw0_original.ipynb`. An \"add/commit/push\" cycle will make sure these changes go into your fork as well. If you intend to work on the changed file `hw0_original.ipynb`, simply copy the file to `hw0.ipynb` and work on it. \n", | ||
"\n", | ||
"Remember that we will be looking for files `hw0.ipynb`, `hw1.ipynb`,...,`hw5.ipynb` as the semester goes on.\n", | ||
"\n", | ||
"This process is summarized in the diagram above.\n", | ||
"\n", | ||
"The homework repos are private, shared between you and the course staff. DO NOT share them or add any collaborators. That will violate the Honor Policy." | ||
] | ||
|
@@ -1916,15 +1936,48 @@ | |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Unlike homeworks, Labs are available publicly. \n", | ||
"Lets talk a bit about how labs and sections work in this course:\n", | ||
"\n", | ||
"![homework](cs109gitflow3.png)\n", | ||
"1. Lab Notebooks are made available every Thursday evening.\n", | ||
"2. Lab Videos (which may not cover everything in the notebooks) are made available every Friday as well\n", | ||
"3. In sections starting Monday morning, and running upto the next Friday, your TA will present part of the lab to you. You ought to have looked at and perhaps tried the lab over the previous weekend, and your section might reach a consensus on what you'd like your TF to focus on: please communicate this.\n", | ||
"\n", | ||
"(Sections are 2 hours long. The first hour will be spent going over the lab, while the second if an office hour, where you can ask your TA questions about the homework, the lectures, the subject matter, and even the lab).\n", | ||
"\n", | ||
"The labs will be made available on public github repositories, with naming schemes like `cs109/2015lab1`.\n", | ||
"\n", | ||
"This is how you ought to work with them (our github tutorial has an example of this process on the `cs109/testing` repository):\n", | ||
"\n", | ||
"Here you will fork our repository, clone you fork, and work on your clone. Once again, DO NOT work on any files like `lab1_original.ipynb`. If there are any changes you will be able to incorporate them into the `lab1_original.ipynb` file from the `course` remote (the one you forked) without clobbering your own work in `lab1.ipynb`.\n", | ||
"1. First fork the lab from the github web interface. For example, the first lab is at: https://github.com/cs109/2015lab1 . The fork button is at the upper right corner of the page. Press it.\n", | ||
"2. When it asks you where to fork the lab, choose your own github userid. The web interface will then take you to the web page for your fork. Mine is at: https://github.com/rahuldave/2015lab1 .\n", | ||
"3. Now look for the clone url at the bottom right of the page. If you set up your ssh keys, use the ssh url, else use the https url. Mine are `[email protected]:rahuldave/2015lab1.git` and `https://github.com/rahuldave/2015lab1.git` respectively. \n", | ||
"4. Clone your fork down to your machine by obtaining a terminal (`/Applications/Utilities/Terminal.app` or equivalent on mac and `git-bash.exe` on windows). Change (`cd`) into an appropriate folder and clone by doing `git clone url` where the `url` is the one in step 3.\n", | ||
"5. Add a remote for the original repository that you forked from. We'll call this remote `course`. The command for this, for example, for the first lab is: `git remote add course [email protected]:cs109/2015lab1.git` or `git remote add course https://github.com/cs109/2015lab1.git`\n", | ||
"6. Now you have a local repository. Start the ipython notebook in the repository and run the labs. DO NOT run the notebooks ending in `_original.ipynb`. These are simply copies of the labs. We made these copies so that you can update them from our `course` remote in case we make any changes.\n", | ||
"\n", | ||
"Your fork will also be public." | ||
"For Lab 1 I'd start with pythonpandas, followed by babypython, and finally git. The git notebook can be run under the ipython notebook. But the git commands can also be run directly on a terminal, which is probably the best place to do them...you can keep the notebook on the side to read as you follow along). So after once having read the tutorial, as described earlier, you now get to work through it.\n", | ||
"\n", | ||
"When you follow along, you can add in your own notes, and try your own variations. As you are doing this, dont forget to continue doing the \"add/commit/push\" cycle, so that you save and version your changes, and push them to your fork. This typically looks like:\n", | ||
" - git add .\n", | ||
" - git commit -a\n", | ||
" - git push\n", | ||
" \n", | ||
"In case we make changes, you can incorporate them into your repo by doing: `git fetch course; git checkout course/master -- labname_original.ipynb` where `labname.ipynb` is the lab in question. An \"add/commit/push\" cycle will make sure these changes go into your fork as well. If you intend to work on the changed file, simply copy the file to another one and work on it. Or you could make a new branch. Remember that this fork is YOUR repository, and you can do to it what you like. Your fork is public.\n", | ||
"\n", | ||
"The diagram below should help elucidate the above and serve as a command cheat-sheet.\n", | ||
"![homework](cs109gitflow3.png)\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
|
Oops, something went wrong.