prerequisites
this howto assumes that you have already made a clone of your group's git repository, somewhere that you can work with it. for more information on cloning your repo, refer to this howto guide.
using git to stage & commit local changes
assuming you are in the directory containg your freshly cloned matplotlib repo,
lets ask git what the status of your local copy is:
one great thing about git is that it always tells you what to do next. if you look at the image above, you can see that git is telling you what to do to stage the changed file to commit to your local repo:
(use "git addor, if you accidently changed the file, or otherwise want to overwrite the change with what's in the local repo:..." to update what will be committed)
(use "git checkout --and it even suggests a way to stage the change(s) for commit and commit them all at once, as the last line of output from the status command, assuming you are a pro!..." to discard changes in working directory)
lets assume we want the change, so we'll do as git suggests and stage it:
> git help addand to see all of git's commands, run:
> git helpok, back on track now, after staging the chage (see highlighted command) we then ask git for status again. notice now that it showes the staged file (in green if you have colours configured), and it tells you how to unstage it if you like. instead of unstaging, lets assume we want the change, and commit it, to our local repo:

using git to push & pull changes to & fro
it's always good practice to pull before you push. this will allow you to see if your local changes will conflict with anything in the repo you are pulling from (the origin in this case). also, it will give you the opportunity to test your changes along side those of your group members to see if there are any issues before giving it to them.
so, lets do it, lets pull from our origin repo:
ok, so we're up to date, great! if there were changes, git would attempt to auto-merge them for us. in the event that the auto-merge failed, we'd have to merge them by hand. that is something we'll cover elsewhere.
ok, now we are finally ready to share our changes, in our local repo, with the rest of the group
bu pushing them to the origin repo:
final remarks
so this concludes our brief csc302h git tutorial. we didn't cover manually handling conflicts and merges, which is something you will need to master later. there are also a plethora of other things you can do with git, so please treat this as the bare minimum to get by in csc302h. i encourage you to seek out some of the many excellent git tutorials on the web and learn how to do things like:
- configure console colours
- create shortcuts for git commands like: status, commit, checkout, etc.
- use branches with git to implement a workflow
- tell git (via .gitconfig) to cache your login credentials to avoid entering them repeatedly
- fetch & merge the master branch of matplotlib from github
- many more...