This week's lessons introduce the concepts of version control using Git. Here's some motivation, including a PhD comic. If you have used "track changes" in a word processor, you are already familiar with a simple form of version control. Git is a tool that dramatically expands these capabilities to include any kind of text file. This will be particularly useful when working collaboratively on data analysis projects that use script files for data analysis.
NOTE: you will need to create a free github account in order to follow along with some of these lessons, and do the collaboration exercise.
The page with the index to all lessons, as well as links to additional resources is here.
git diff into your answer file.planets repository referred to in the exercise. The following assumes you
are in your user directory (or anywhere else you can create files), and if you do
ls it does not show a directory called planets.git clone https://github.com/atyre2/planets-template.git planets
cd planets
git remote set-url origin https://github.com/yourusername/planets.git
git remote -v
This copies the repository from my github to your harddrive, and then
changes the remote repository from my github to a repository on your github
account. If you try pushing to that repository however, you will discover that
the planets repository is not found. Point your browser to github.com/yourusername
and add a repository named planets. After that you will be able to git push origin master
from the planets directory and it will push the contents to your remote repository.
Now you are ready to do the exercises below with a partner.
In the following, one of you will be the "Owner" and one will be the "Collaborator". If you are the collaborator, when you clone the contents of the Owner's repository you should change the name of the directory to planets-OwnersUserName to keep it seperate from your own planets repository.
git log in your planets directory and copy the results to your
Challenge Answers file.Challenges are due on Friday of Week 4 (Feb 5) at 5 pm. Late assignments will receive a score of zero unless prior approval is granted. Your answers should be entered into a plain text file. At the top of the file write the week number and your name on one line. Leave a blank line, and type the name of the lesson. For each challenge in the lesson, on one line, give the title of the Challenge. On the next line, enter your answer. This may be simply a number in the case of a multiple choice question, or perhaps a couple lines of commands or text. Separate challenges with blank lines.