RU beehive logo ITEC dept promo banner
ITEC 325
2018spring
ibarland

git usage
hw04

Due Oct.11 (Wed)Feb.27 (Tue) at start of class; also see part II, below

  1. Create a bitbucket.org account. You can use whatever name you like, but you must make sure that you your bitbucket account is also associated with your RU email (@radford.edu).
  2. Locally (on your machine, or on rucs), be sure to configure your name and email, as per git; in particular git config --global user.email yourUserName@radford.edu (so that when your local computer makes requests to bitbucket.com, it knows whose password it should be asking for).
  3. Find an email from bitbucket1 inviting you as a member of the ibarland/itec325-2018spring-hw04 repository; accept that invitation (sent 2018-Feb-16 around 12:40).
  4. Locally, clone my (public) repository:
    git clone https://yourUserName@bitbucket.org/ibarland/itec325-2018spring-hw04.git”.

    I suggest doing this somewhere within your H: drive’s dynamic_php/ (mounting your H: drive if on your laptop), so you can view the results via the web. However, that isn’t required (e.g. if your disc quota is low).

    Alas, the version of git that is currently on rucs is old2; it mostly works, except for cloning repos via https3, which is the one step we need to get started!

    1. The easiest workaround, if you have your own machine w/ administrator privileges, is to download/install git there.
    2. You can clone the repo on rucs via ssh by just omitting the https:// above — git clone yourUserName4@bitbucket.org:ibarland/itec325-2018spring-hw04. You just need to generate a public/private key pair first (by running ssh-keygen). You'll have the private key stored locally (in ~/.ssh/id_rsa), and you'll give bitbucket.org a copy of the public key (http://bitbucket.org » your avatar » Bitbucket Settings » SSH keys » Add). The project itself has a couple files re-going-over these same instructions for creating ssh keys and adding ssh keys to bitbucket.

      Debugging: You can test whether your public-key-on-bitbucket is working independently of git by testing ssh -T hg@bitbucket.org (yes, include the “hg” literally); if it shows “logged in as yourUserName” then your public-key is all set. If it shows “Permission denied (publickey)” (or something else), then you need to double-check that the private-key on your machine corresponds to the public-key you have listed in your bitbucket profile » preferences.

  5. Edit facts.txt, along with some two-facts-and-a-lie about yourself. (Note: this file will be public on my bitbucket account!)
    Follow the existing format (each fact starts with username, colon, etc.). As always, grammar/spelling counts.
  6. Add a small picture to the project, using git add. Update picts.php so that it includes a clickable thumbnail of that page. (A picture of anything polite, and you must have the right to copy it.)

    Make sure your picts.php works correctly!

  7. Commit your changes to your local repo, with a short (≤ 1 sentence) message saying what you did. You can use “git commit .”, which will cause an editor to launch for you to write the commit-message in. Alternately, you can run “git status .” (to be sure you recall all the files you changed), followed by “git commit -m "your message" .” to commit all changes to the current directory, ..
    Warning: If you commit and get a warning about a conflict, be sure to resolve it before (re)committing. You'll get no credit if you commit something which includes the conflict.
  8. Push your changes back to the public repository.
    Hint: If you get an error about “not authorized” for writing to the repository, it may be because you didn't respond to bitbucket.org's invitation link in step 3 above. (The repo is world-readable — so just because you could clone it doesn't mean you also have write permission.)
    If the invitation-link has expired, let the prof know, and they can re-send the invitation.
  9. Note: in the following days, I'll have each person make a change to the file, and then I'll be asking a D2L question based on your classmates' updated version.

Common mistakes:


Part II

due 2018.Feb.29 by start of class; only complete this after the the part I deadline above.
(5pts) Go back to your entry in facts.txt, and:

You must, of course, push your changes back to the central repo, or else I won't see them!


1Check your spambox. If you can't find it, you can go to your bitbucket account page, and have the invitation re-sent.      
2on rucs, git --version gives 1.5.4.3, as of 2018-Feb-16; we want a version ≥ 1.8.      
3 The error message in this case is:
Initialized empty Git repository in /itec325-2018spring-hw04/.git/
Cannot get remote repository information.
Perhaps git-update-server-info needs to be run there?
       
     
4In fact, you can replace your username with “git@” and it will still work — apparently the crypto-challenge being sent embeds your public key?, which bitbucket can look up and see which bitbucket-user has that public-key on file (presumably using a hash table).      
5 And to sustain the confusion: you might see a classmate’s old work in your parallel bitbucket copy of the repo, just because it was already present at the moment you made your initial clone.      

logo for creative commons by-attribution license
This page licensed CC-BY 4.0 Ian Barland
Page last generated 2018.Feb.20 (Tue)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.