CISC 3120

About GitHub

As part of the introductory survey, you should have given me your GitHub username. If you haven't done so yet, please complete that survey!

We'll spend a class session practicing git/GitHub actions, but before then, here's a little basic info:

GitHub is, roughly speaking, a hosted source code management solution (though it can manage all kinds of project, not just software development). It uses the rather awesome software git. It is a distributed source code management tool, which means that it's very easy to work on code with multiple collaborators (a few, a few hundred...), very easy to work on your code from multiple locations, and also very easy to keep track of your work, try different approaches, and decide what you want to keep and what you want to discard. For the purposes of this class, there are two fairly limited uses we'll have for GitHub:

So, first: all the published material for the course (including this page) is in a GitHub repository at

https://github.com/BC-CISC3120-F16/BC-CISC3120-F16.github.io

As you'll soon learn, this page lets you see exactly what changes I've made to the course web pages as the semester progresses.

Second: assignments. Once I have your GitHub username, I will make you part of the class "organization" on GitHub. For each project I assign, I will create a "private repository" for you, with a copy of the assignment and any 'skeleton' code the project needs. You will "clone" this repository to whichever computer you're using, make changes to the project there, and regularly "push" your work to your private repository on GitHub. If you have questions, you can ask me about them and I can just look at your code on GitHub. When it comes time to grade, I will clone your repository to my computer, then push it back with my grading comments. And yes, I'll give you instructions about how to do all of this: it takes a little time to get used to, but it's a very powerful way of working with code.


Using GitHub

Please read the first two chapters of the git book ("Getting Started" and "Git Basics"). This will give you a basic sense of what git is for. Don't worry about memorizing command-line stuff; mainly, we'll be interacting with git through Eclipse and GitHub rather than the command line. But the main concepts (like 'repository,' 'clone,' 'commit') are fundamental no matter what interface to git you're using.

Our GitHub lab will give you some practice with these concepts. When we start working on programming projects, you'll apply these concepts, following the instructions below.

GitHub and Your Projects

For at least the first two programming assignments (#0 and #1), I will give you a private repository on GitHub. Open your GitHub account and find the main page for this repository. Copy the URL of the page (something like http://github.com/myaccount/project0-intro ).

Now, open Eclipse and import the project/repository. Go to File->Import and, under the "Git" option select "Projects from Git" In the window that pops up, select "Clone URI" (and click Next). In the next window, paste in the URL you copied from GitHub (in the "URI" field). You will need to enter your GitHub username and password in the bottom of the window.

That gets your project hooked up with git and GitHub. You should have a project named something like project0-intro .

Now comes the good stuff. Every time you get a little bit of progress made on your work, you should Commit it. (Explore my repository for the class webpage to see some example commits.) To do this, right-click on any file in your project (or the project folder itself), and from the "Team" submenu select "Commit..." (there is also a keyboard shortcut, which will depend on your operating system ). This will bring up a window. Enter a brief explanation of what changes you made (again, look at my commits); you can add a longer explanation if you like, Just leave a blank line after your brief description, then write as much as you like. If you then click the "Commit" button, you will record this 'snapshot' of your current state of work in your local copy of the project. If you select "Commit and Push," this snapshot will also be recorded on GitHub--this is both an easy form of backup, and it also lets me ssee how your work is progressing.