CS174
Chris Pollett
Oct 24, 2016
Purpose: Second chance at course learning outcomes from the midterm. Successful completion of bonus is worth half back for the points you lost on the midterm.
Due Date: Dec 12 before office hours over.
Description: Write a PHP program, present it to me, and answer questions about it during my office hours on my white board without notes. Your program should read into an array of lines, $lines, every kth row of file foo.txt in the current working directory. Here k should be a define to the 5th digit of your student id. Your program should take the $_REQUEST['foo'] variable and check if it is a string. If it is a string, it should insert the tuples ($line, $_REQUEST['foo']) for each $line in $lines into a mysql table FOO using a prepared statement.
git init name_of_git_repository.
git clone path_to_clone_from to_folder #from scratch case git pull path_to_from_repos branch_name_you_want_to_pull_into #existing case git checkout branch #makes branch the current branch in the repository you are working on
Which of the following statements is true?
Which of the following statements is true?
mkdir myrepos cd myrepos git init git add . echo "hi there" > test.txt git add test.txt git commit -a -m "Initial commit" cd .. git clone file:///Users/cpollett/myrepos myrepos2 cd myrepos2 # now start editing myrepos2 echo "test2" > test2.txt git add test2.txt git commit -a -m "Made some changes" cd ../myrepos #now want to get changes back in myrepos git pull file:///Users/cpollett/myrepos2 masterThis produces a copy of the repository in a separate folder. We then edit the copy, and pull the changes back (the changes were in the clone's master branch) into the original repository. We will describe git add and git commit in a moment.
git pullas git will default to pulling where it was cloned from.
<Location /git/myrepos.git> DAV on AuthType Basic AuthName "My site" AuthUserFile /etc/apache2/myrepos.passwd <LimitExcept GET HEAD PROPFIND OPTIONS REPORT > Require valid-user </LimitExcept> </Location>
mkdir myrepos.git cd myrepos.git git init --bare git update-server-info
sudo chown -R _www . sudo chgrp -R _www .
sudo httpd -k stop sudo httpd -k start
git config -l #lists current config settings. git config setting_name new_value #changes a setting
git config --global user.name "Your Name Comes Here" git config --global user.email you@yourdomain.example.com
git config remote.upload.url http://myserver/git/myrepos.git
cd myrepos git init git add . git commit -m "setting up initial repository" git push upload masterThis might ask for password info. If you like you can configure a ~/.netrc file to save this info. This is a file on *nix systems with the following lines:
machine [servername] login [username] password [password]where you replace what's in brackets with the relevant info.
git add file_or_folder #folders added recursively, #.gitignore can be used to list files you don't want added or managed. git clean #gets rid of files git doesn't know about git rm file #removes the file from the repository, with -f deletes from filesystem git mv loc1 loc2 #moves file from loc1 to loc2 git checkout [rev] file #gets the [rev] version of the file into the current branch #-f overwrites uncommitted changes. # Checkout master to go back to the most recent revision