Friday, January 20, 2012

Getting used to SVN

To ensure that you all get some practice with SVN as soon as possible, I want everyone in the class to do the following.
Checkout everything from my pub-svn directory, using this command from within your CS account:

svn checkout file:///nfs/faculty/hayes/pub-svn working

cd into the directory named "working" (the above line created it if it didn't exist already), and add one line of text to the file roster.txt, containing your username.

svn status should now print:
M roster.txt indicating that you have modified that file from its checked out version.

svn commit -m "added my name" commits the new version of roster.txt back into the repository.

svn log will show the record of all past changes to the repository.

If you are unlucky, someone else may have committed a new version in between your checkout and commit steps above, in which case the commit will fail. In this case you can type "svn update" to bring your version up-to-date.

I'll be checking the log files, so please impress me by doing this exercise promptly.

Questions? Post a comment below.

12 comments:

  1. Can you tell me what I'm doing wrong?
    http://i44.tinypic.com/f20gih.png

    ReplyDelete
    Replies
    1. The output of sed goes to stdout, and you are just displaying this on your terminal, rather than storing it in the text file.

      If you want to do your editing from the command line, rather than opening a text editor, you could just do:
      echo tgarwood >> roster.txt

      Here is one online tutorial on I/O redirection in unix:
      http://www.mathinfo.u-picardie.fr/asch/f/MeCS/courseware/users/help/general/unix/redirection.html

      Delete
  2. How do we connect to the linux server with our CS account?

    ReplyDelete
    Replies
    1. I used "ssh [myusername]@moons.cs.unm.edu" at the command line. I think @trucks.cs.unm.edu connects to the cs computers too.

      Delete
    2. I keep getting permission denied even though I set up my account. Am I just doing it wrong or do I need to have a word with who set it up for me?

      Delete
    3. If you are able to log into the moons server you should not receive a permission denied message. Double check the path you are using to check out the folder, that you are using the file:// protocol, and that the directory you are checking out is within a file system you have permissions to create data. If you type "cd ~/" you will be in your home directory where you have full permissions to create and modify data.

      Delete
    4. From a terminal on a linux computer or mac you can type without the quotes, "ssh username@moons.cs.unm.edu". For example my username is jcollard so I type "ssh jcollard@moons.cs.unm.edu. I am then prompted to enter my CS account password. This may be different from your net id password.

      If you use the computers in the lab on the third floor of Farris Engineering Center, you are already logged in and can skip the connection step.

      Delete
    5. Thanks for the reply. There was an issue with my username. Visited the Farris building and got it sorted. We're good to go now.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. How do I add my line of text to a .txt file? If I can do this, I can finish the assignment.

    Thank you for your help

    ReplyDelete
    Replies
    1. Hi Jeff, you need to use a text editor to modify this file. There are several on the moons computers that have a text interface. One is called emacs. Another is called vi. Both have a little bit of a learning curve.

      Here is a simple emacs tutorial: http://www2.tcs.ifi.lmu.de/~abel/tutch/tutch_10.html

      Here is a vi tutorial:
      http://www.eng.hawaii.edu/Tutor/vi.html

      Best of luck!

      Joe

      Delete
    2. Hi Jeff. Also relevant is my reply to tgarwood earlier in this thread, dated Jan 22, 2012 09:46 PM.

      Delete