Dude, Where's My Class?
...where's my code?
GrizSpace is a cloud-based, class scheduling, social photo sharing, navigation, and productivity iPhone app. We developed it as our final projects in our human-computer interaction and mobile application development courses at the University of Montana-Missoula.
git clone ...
XCode's Git integration is great, unless you're collaborating with anyone. Thus, you'll need to use the shell (or try it with GitHub app).
master -- this is stable. Do not push directly to this unless you know your commits do not break the build.
fix-34-arrow-is-inverted -- this is an example of a topic branch. These are short-lived branches that are for bugs or features. The reason behind a short, topic branch is they're easier to merge into master than a long-lived, user-specific branch.
- If you have a "dirty" repo, run
git stash save "My WIP"to set your changes aside
git pull --rebaseto pull changes
git logto view a log of recent commits
git show <some SHA1 hash>(or
git showwith no arguments to view a diff of the last commit)
git stash popto pop your stashed changes off (i.e., make them current and visible)
A visual tool like GitHub app or GitX is recommended for staging changes (these let you stage hunks of code instead of whole files).
git statusto see what files are modified or untracked. If it's untracked, then Git doesn't know about it. This is important: Committing modified files that depend on untracked files does not add the untracked files.
git diffwill show your modifications to tracked files. By default, this will open it up in a pager program (
less). If you'd prefer a GUI, Google "git diff opendiff|Filemerge".
git add <filename>, regardless of whether it's modified or untracked. This is referred to as "staging" the commit.
git commitwill open whatever your default
Control). Keep the first line of your commit to 50 characters or less, otherwise your message will be garbled on GitHub and in the CLI. Leave a blank line, and then make your next line as long as 72 characters.
My descriptive commit SUBJECT This explains more about my commit. You do not need to specify your name or date since that is metadata associated with the commit. If you are having a hard time writing a succinct subject line (50 chars), chances are your commit is doing too much. Break it into smaller commits.
You do not have to push after every commit. In fact, it is probably best if
you do not so you can fix typos and not break builds (look into
git commit --amend for fixing commit typos or adding skipped files).
git statusshows you your current repo status
git pull --rebaseto check
git checkout masterensures you are on the master branch
git checkout -b my-new-branch-with-descriptive-namewill create a new branch and check it out (switch to it).
git push origin my-new-branch-with-descriptive-namewill push the branch up to GitHub. This is not necessary unless you want to share your changes with us.
Try to merge commits into master sooner rather than later to avoid hairy merges. Here's how you do it from shell:
git checkout master
git merge --no-ff my-new-branch-with-descriptive-namewill merge your branch into master.
git branch -d my-new-branch-with-descriptive-namewill delete your topic branch.
We are storing just the text SQL in
data/*.sql instead of the binary
.sqlite file. This allows us to do text-diffs between schema and data, and
as a result, we have more control.
rake db:schemaif you want to commit schema changes
rake db:dataif you want to commit data changes
rake db:dumpfor both schema and data
rake db:setupto load the schema and data
If you'd like to run the import, you need to install two gems first:
sudo gem install sqlite3 sequel --no-ri --no-rdoc
rake -rrubygems import_courses.