# Homework 1, due 23.59, 26/8-2016¶

## Version control and Git¶

1. Find a lab-partner.
3. Create a new repository by clicking the plus sign in the upper right corner. The repository should be private. Make sure you give it a unique name, for example I could name it D_Appelo_471 (don’t use just Math471!)
4. Set up Git on your machine (if you are using your personal computer) if you haven’t already. There are good instructions on the official git-scm.com.
5. Follow the instructions for command line, “I’m starting from scratch”.
• Set up your local directory.
• mkdir apa
• cd apa
• git init
• git remote add origin https://lobogit.unm.edu/appelo/apa.git
• Create your first file, commit, and push
• echo "Jane Doe" >> contributors.txt
• git add contributors.txt
• git commit -m 'Initial commit with contributors'
• git push -u origin master
6. Now we will clone the repository you just created. Go to the root of your home directory (i.e. type cd) and create a directory where you keep all the repositories, e.g. mkdir repos and change into that directory (cd repos.)
7. Next point your browser to your repository on lobogit.unm.edu. To the left there is a actions menu, click on clone and copy the text (something like git clone https://username@lobogit.unm.edu/username/your_repo.git) to your terminal window and hit enter. You should now have a directory with your repository that you can go into.
8. In the directory your_repo create a file called README.rst. The extension .rst indicates that this file is written in reStructuredText.
9. To hand in the homework in this class you will send me (appelo@unm.edu) and Denis (dsilant@unm.edu) a SHA-1 checksum that identifies the version of your repository that you want me to grade (more about this soon). NOTE that you have to add us as members of your repository! Upon grading we will first read the readme file where you will put instructions where we can find the report and code for each homework. For example it could contain something like:
  1 2 3 4 5 6 7 8 9 10 11 12 13 +++++++++++++++++++++++++++++++++ README file for Jane Doe Math 471 +++++++++++++++++++++++++++++++++ 1. Homework 1: - The report is in the directory Homework1/Report and is called homework1.pdf. - The code for this homework is located in Homework1/Code and is documented in the appendix of the report. - To reproduce the results in the report do this (where this is a description of how to recreate the results). 
• git add README.rst
• git commit -m "Added a README"
• git push
2. You can inspect your activity by git log it should look something like this:
  1 2 3 4 5 6 7 8 9 10 11  commit 84e7a3e57bf0e10dbb9a998d55b5976e55514ad3 Author: Daniel Appelo Date: Tue Aug 5 09:47:27 2014 -0600 Added a README commit 78db2b57948e1778e62cd9118e78ee83f6f0af82 Author: Daniel Appelo Date: Mon Aug 4 17:39:28 2014 -0600 Initial commit with contributors 
1. Play around with git and add some directory structure and files to your repository, perhaps homework folders for the first few assignments.
2. Add a version of “Hello World!” in your favourite language in Homework1/Code along with a report describing how to compile and run the program.
3. To submit your homework for grading first add me and Denis as members to your repo by Settings -> Members -> New project member. We will need write privileges to add comments. Then, when you are ready to submit (before the due time / date), send me an email with the SH1 checksum from the appropriate commit (use git log to get the checksum.)