...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.
- William J. Lyon
- Jon-Michael Deldin
- Kevin Scott
- Jaylene Naylor
git clone ...
cd GrizSpace
rake db:setup
Please see the Pro Git (free) for an overview, or GitHub's excellent help.
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 --rebase
to pull changesgit log
to view a log of recent commitsgit show <some SHA1 hash>
(orgit show
with no arguments to view a diff of the last commit)git stash pop
to 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 status
to 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 diff
will 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 commit
will open whatever your default$EDITOR
is (probablynano
--^
means pressControl
). 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 status
shows you your current repo statusgit pull --rebase
to checkgit push
git checkout master
ensures you are on the master branchgit checkout -b my-new-branch-with-descriptive-name
will create a new branch and check it out (switch to it).git push origin my-new-branch-with-descriptive-name
will 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-name
will merge your branch into master.git branch -d my-new-branch-with-descriptive-name
will 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:schema
if you want to commit schema changesrake db:data
if you want to commit data changesrake db:dump
for both schema and datarake db:setup
to 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
Then run rake -rrubygems import_courses
.