Git is a version control system. With git, you keep a master copy of your project on the github server, plus you can keep a copy on each computer that you use to work on the project. (For example, I have a master copy of these web pages on the server, plus a copy on each of the three computers that I typically work on). If you are working on a pair project, you might keep one copy on each partner's machine.
A general introduction to git can be found here. A video demonstration of git and github can be found here.
Your daily workflow with git looks as follows:
- Always start a work session by opening up your github client (either Github for Windows, Github for Mac, or your command-line client), opening your repository, and hitting "refresh". (You may need to go to the dashboard to get it to refresh). This will get the latest versions of all the files from the server and put them into your local copy. In what follows, we'll assume you are using GHFW or GHFM; we'll refer to these as GHF*.
- Do your work.
- As soon as you change or add files during your work session, the text in GHF* that says "No uncommitted changes" will change to "uncommitted changes". You can commit your changes by clicking on "show" and choosing the changes (including new files) that you want to commit. When you do this, the little checkmark at the top of the window that says "in sync" will change to "sync". Click this icon to publish your changes to the server. We recommend you do this often. It is helpful if you use informative messages when you commit.
- At the end of your work session, you MUST commit your homework assignment AND YOUR LABORATORY NOTEBOOK, and publish your changes to the github server. This gets your new versions onto the server, where they will be available for your or your partner at your next session.
- Check whether your homework is visible by logging in to Github and seeing whether your changes are visible there. You can also do this by clicking "Tools" and "View on Github" in GHF*. Be sure to do this step when you are submitting your assignment!!
- NEVER exchange code by email or other channels. ALWAYS use the github repository. That way there is never any confusion about which version is the most up-to-date one. You can always use git to revert to earlier versions if you need to.
There's more, but that's the basic idea.
When you see documentation about Git, you will see lots of stuff about branches, merges, indexes, etc., etc. Don't worry about any of that. If you know about branches and want to use them as part of your workflow, feel free to do so; just submit your assignments in the branch master.
A useful tip: as soon as you get one piece of your task working, commit it. (You don't have to sync it until later). That way, if you screw things up on the next set of changes, you can always undo your bad work by clicking on "revert commit" (not "rollback", unless you know what you are doing). Reverting will get you back to the exact same state you were in when things were working, and you can try again.
Git (and other version control systems) become even more valuable when there are many people working on a project, perhaps from many different places. In a company setting, this is vital, and there are often restrictions on who can check files into the master copy of a project. Luckily we don't have to worry about these complications.
You may eventually have to deal with the situation in which you and your partner have committed incompatible changes to the server. A discussion of this situation and what to do about it may be found here.
There are lots and lots of tutorial materials on git and github. Find your favorite on the internet. If you find some that are particularly good, please share them with the class by posting links on Piazza.
Local Details
- We will be creating a private repository for you in https://github.com/cs5010f13/YOUR-CCIS-LOGIN-NAME. Later on, we will be creating private repositories for each pair.
- You will turn in your homework problem set NN by leaving it on your github repository in a directory named psNN.
- If you do not check in your assignments nightly, we will assume that you are not working on the assignment. Checking in your partially-completed assignments also serves to prove that you actually did the assignment yourself. If you only check in the final version of your assignment, we will assume that you probably stole the code from somewhere.
- Note also that nightly check-ins mean that you will always have a backup of your work. If you screw things up, you can always revert to an earlier version.
- On the due date, an automated script will collect every pair's current solution at midnight. Since you will commit intermediate solutions, you are guaranteed to have some solution available when we conduct code walks on the following Thursday and Friday sessions. For these code walks, we will use the code that we collected on the due date. We will not use a revision that you submit later. Never.
Last modified: Tue Aug 27 22:32:15 -0400 2013